progress_image 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 77

progress_image

#####flutter的图片上传进度(类似qq发送图片)

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation. image

##How to use ?

  1. Depend on it
dependencies:
  progress_image: "^0.0.1"
  1. Install it
$ flutter packages get
  1. Import it
import 'package:progress_image/progress_image.dart';

##属性

  • width 宽度
  • height: 高度(影响水波纹大小)
  • builder: 返回显示的内容
  • initProgress: 默认进度,-1代表默认不显示阴影遮罩,0代表显示遮罩

##Example

import 'package:flutter/material.dart';
import 'package:progress_image/progress_image.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  GlobalKey<ProgressImageState> progressImageKey =
      new GlobalKey<ProgressImageState>();

  void _incrementCounter() {
    progressImageKey.currentState.setProgress(100);
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new ProgressImage(
                key: progressImageKey,
                builder: (BuildContext context, Size size) {
                  return new Image.network(
                    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527862078037&di=3ce4750ed2aa7629c2e25e49f065e06e&imgtype=0&src=http%3A%2F%2Fimg15.3lian.com%2F2015%2Ff2%2F82%2Fd%2F7.jpg',
                    width: size.width,
                    fit: BoxFit.fill,
                    height: size.height,
                  );
                }),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
有需求的话,后期再加入其他的吧

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:progress_image/progress_image.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  GlobalKey<ProgressImageState> progressImageKey =
      new GlobalKey<ProgressImageState>();

  void _incrementCounter() {
    progressImageKey.currentState.setProgress(100);
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new ProgressImage(
                key: progressImageKey,
                builder: (BuildContext context, Size size) {
                  return new Image.network(
                    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527862078037&di=3ce4750ed2aa7629c2e25e49f065e06e&imgtype=0&src=http%3A%2F%2Fimg15.3lian.com%2F2015%2Ff2%2F82%2Fd%2F7.jpg',
                    width: size.width,
                    fit: BoxFit.fill,
                    height: size.height,
                  );
                }),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  progress_image: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:progress_image/progress_image.dart';
  
Version Uploaded Documentation Archive
0.0.2 Jun 5, 2018 Go to the documentation of progress_image 0.0.2 Download progress_image 0.0.2 archive
0.0.1 Jun 3, 2018 Go to the documentation of progress_image 0.0.1 Download progress_image 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/progress_image.dart.

Run flutter format to format lib/progress_image.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <2.3.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test