progress_dialog 1.0.5 copy "progress_dialog: ^1.0.5" to clipboard
progress_dialog: ^1.0.5 copied to clipboard

discontinued
outdated

A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it. It is a stateful widget so you can dynamically change the text [...]

example/lib/main.dart

//import 'package:progress_dialog/progress_dialog.dart';
import 'package:flutter/material.dart';
import 'ppd.dart';

ProgressDialog pr;

void main() {
  runApp(MaterialApp(
    home: MyApp(),
  ));
}

class MyApp extends StatelessWidget {
  var percentage = 0.0;

  @override
  Widget build(BuildContext context) {
    pr = new ProgressDialog(context,ProgressDialogType.Download);
    pr.setMessage('Downloading file...');
    return Scaffold(
      body: Center(
        child: RaisedButton(
            child: Text(
              'Show Dialog',
              style: TextStyle(color: Colors.white),
            ),
            color: Colors.blue,
            onPressed: () {
              pr.show();
              Future.delayed(Duration(seconds:2)).then((onvalue){
                percentage = percentage+30.0;
                print(percentage);
                pr.update(progress: percentage,message: "Please wait...");
                Future.delayed(Duration(seconds: 2)).then((value){
                  percentage = percentage+30.0;
                  pr.update(progress: percentage,message: "Few more seconds...");
                  print(percentage);
                  Future.delayed(Duration(seconds: 2)).then((value){
                    percentage = percentage+30.0;
                    pr.update(progress: percentage,message: "Almost done...");
                    print(percentage);

                    Future.delayed(Duration(seconds: 2)).then((value){
                      pr.hide();
                      percentage = 0.0;

                    });
                  });
                });
              });
            Future.delayed(Duration(seconds: 5)).then((Value){
              pr.hide();
            });

            }),
      ),
    );
  }
}
239
likes
0
pub points
95%
popularity

Publisher

unverified uploader

A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it. It is a stateful widget so you can dynamically change the text shown there.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on progress_dialog