Giter Club home page Giter Club logo

progress_dialog's Introduction

progress_dialog

A light weight package to show progress dialog. As it is a stateful widget, you can change the text shown on the dialog dynamically.

Thank you for being a user of this package, this package is discontinued due to serveral reasons, please find the other library which you can use to accomplish the task which this package does and I believe that package will be more helpful. Please find the repo link here for OTS (Over the screen)

  LinkedIn   Fork   Star   Watches

Get the library   Example

Supported Dart Versions

Dart SDK version >= 2.7.0

Demo

Normal dialog Demo Download dialog Demo

Installation

Pub

Add the Package

dependencies:
  progress_dialog: ^1.2.4

How to use

Import the package in your dart file

import 'package:progress_dialog/progress_dialog.dart';

Create and initialise a ProgressDialog object inside the build() method passing context to it

  1. Initialize the ProgressDialog object
    final ProgressDialog pr = ProgressDialog(context);
  2. By default it is a normal dialog to show some message, if you would like to use it to show percentage of progress done, specify the optional type parameter and specify if you want your dialog to dismiss when back button is pressed isDismissible parameter (Optional)
    //For normal dialog
    pr = ProgressDialog(context,type: ProgressDialogType.Normal, isDismissible: true/false, showLogs: true/false);
        
    //For showing progress percentage
    pr =  ProgressDialog(context,type: ProgressDialogType.Download, isDismissible: true/false, showLogs: true/false);
  3. > Note: Please initialize the ```ProgressDialog```, where you have availability of the context
  4. Style the progress dialog (Optional)
    pr.style(
      message: 'Downloading file...',
      borderRadius: 10.0,
      backgroundColor: Colors.white,
      progressWidget: CircularProgressIndicator(),
      elevation: 10.0,
      insetAnimCurve: Curves.easeInOut,
      progress: 0.0,
      textDirection: TextDirection.rtl,
      maxProgress: 100.0,
      progressTextStyle: TextStyle(
         color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
      messageTextStyle: TextStyle(
         color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600)
      );
    Note: You don't need to use all parameters, all of them are optional
    
  5. Showing the progress dialog
    await pr.show();
  6. Dynamically update the content shown out there
    pr.update(
      progress: 50.0,
      message: "Please wait...",
      progressWidget: Container(
        padding: EdgeInsets.all(8.0), child: CircularProgressIndicator()),
      maxProgress: 100.0,
      progressTextStyle: TextStyle(
        color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
      messageTextStyle: TextStyle(
        color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600),
      );
    Note: You don't need to use all parameters, all of them are optional
    
  7. Dismissing the progress dialog
    pr.hide().then((isHidden) {
      print(isHidden);
    });
    
    // or
    await pr.hide();

Navigating to next screens must be done after the completion of Future - hide(). See here for example

Check if progress dialog is showing

bool isProgressDialogShowing = pr.isShowing();
print(isProgressDialogShowing);

Use custom body

    pr = ProgressDialog(
      context,
      type: ProgressDialogType.Normal,
      isDismissible: true,
      /// your body here
      customBody: LinearProgressIndicator(
        valueColor: AlwaysStoppedAnimation<Color>(Colors.blueAccent),
        backgroundColor: Colors.white,
      ),
    );

Demo

Normal dialog Demo Download dialog Demo

Default configuration/styles

If you don't like to configure/style the dialog and continue with the default style, it's okay but just have a look at our default configuration.

Attribute Value
Dismissible true
ProgressDialogType ProgressDialogType.Normal
BackgroundColor Colors.white
BorderRadius RoundedRectangularBorder(radius: 8.0)
AnimationCurve Curves.easeInOut
Elevation 8.0
ProgressWidget Double_rings_loding_indicator
MessageTextStyle color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600
ProgressTextStyle color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400
showLogs false

Well let's discuss limits for configuring it

Attribute Can be updated during instantiating Can be updated during styling Can be updated during dialog is shown
Dismissible Yes No No
ProgressDialogType Yes No No
BackgroundColor No Yes No
BorderRadius No Yes No
AnimationCurve No Yes No
Elevation No Yes No
ProgressWidget No Yes Yes
MessageTextStyle No Yes Yes
ProgressTextStyle No Yes Yes
ShowLogs Yes No No

Want to contribute?

Pull requests and issues are always welcome!

How to contribute?

  1. Fork the repository
  2. Clone it to your local machine
  3. Open the project in your favourite editor
  4. Open cmd/terminal and run flutter clean and then flutter packages get
  5. Make the changes
  6. Create a Pull Request

View the issues here

This library is only tested for Android, iOS contributors are most welcome


Loading indicator -> https://loading.io/

progress_dialog's People

Contributors

asundheim avatar dennbagas avatar fayaz07 avatar imgbotapp avatar xsahil03x avatar yahhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

progress_dialog's Issues

How to show progress dialog on initState

Hello admin.

I use code like as. but progress dialog not show. Please guide me. thank you very much.

class UpdateAccount extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => UpdateAccountState();
}

class UpdateAccountState extends State<UpdateAccount>
     {
var user = User();
  @override
  void initState() {
    super.initState();
      _getUserInfo();
  }

  @override
  Widget build(BuildContext context) {
    _progressDialog = ProgressDialog(context);
    return Scaffold(
.....
);

  _getUserInfo() async {
    _progressDialog?.show();
    var userRe = await userRepo.find();
    getInfoUser(userRe).then((user) {
      setState(() {
        this.user = user;
      });
       print("pr show? ${_progressDialog.isShowing()}");
       if (_progressDialog.isShowing()) _progressDialog.hide();
    }).catchError((error) {
      if (_progressDialog.isShowing()) _progressDialog.hide();
    });
  }
}

Getting setState() called in constructor error

Error
Getting error while calling update function on the Progress dialog object.

My Code
ProgressDialog pr = new ProgressDialog(context,type: ProgressDialogType.Normal, isDismissible: false);
pr.style(message: 'Preparing to create event. Please wait...',progressWidget: CircularProgressIndicator());
pr.show();
pr.update(message:'Doing final updates. Please wait...');//ERROR Here

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Android
  • Version 1.2.0

Smartphone (please complete the following information):

  • Device: One plus 3

Additional context
E/flutter (14104): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: setState() called in constructor: _BodyState#12216(lifecycle state: created, no widget, not mounted)
E/flutter (14104): This happens when you call setState() on a State object for a widget that hasn't been inserted into the widget tree yet. It is not necessary to call setState() in the constructor, since the state is already assumed to be dirty when it is initially created.
E/flutter (14104): #0 State.setState.
package:flutter/…/widgets/framework.dart:1129
E/flutter (14104): #1 State.setState
package:flutter/…/widgets/framework.dart:1140
E/flutter (14104): #2 _BodyState.update
package:progress_dialog/progress_dialog.dart:172
E/flutter (14104): #3 _Body.update
package:progress_dialog/progress_dialog.dart:161
E/flutter (14104): #4 ProgressDialog.update
package:progress_dialog/progress_dialog.dart:83
E/flutter (14104): #5 _HazardEventDetailsScreenState.build.
package:mht_flutter/screens/hazard_event_details_screen.dart:185
E/flutter (14104):
E/flutter (14104): #6 _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:654
E/flutter (14104): #7 _InkResponseState.build.
package:flutter/…/material/ink_well.dart:729
E/flutter (14104): #8 GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:182
E/flutter (14104): #9 TapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:365
E/flutter (14104): #10 TapGestureRecognizer.handlePrimaryPointer
package:flutter/…/gestures/tap.dart:275
E/flutter (14104): #11 PrimaryPointerGestureRecognizer.handleEvent
package:flutter/…/gestures/recognizer.dart:455
E/flutter (14104): #12 PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:75
E/flutter (14104): #13 PointerRouter.route
package:flutter/…/gestures/pointer_router.dart:102
E/flutter (14104): #14 GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:218
E/flutter (14104): #15 GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:198
E/flutter (14104): #16 GestureBinding._handlePointerEvent
package:flutter/…/gestures/binding.dart:156
E/flutter (14104): #17 GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:102
E/flutter (14104): #18 GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:86
E/flutter (14104): #19 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (14104): #20 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (14104): #21 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (14104): #22 _invoke1 (dart:ui/hooks.dart:263:10)
E/flutter (14104): #23 _dispatchPointerDataPacket (dart:ui/hooks.dart:172:5)
E/flutter (14104):

Support for dark/light theme

Instead of manually setting a background color and the text color, by default the dialog should follow the theme. dark or light

Progress Indicator Not Showing

Hi,

When i use this dialog, there is no progress indicator. The screen only has text. Is there any idea about this issue?

Error: type 'FlutterError' is not a subtype of type 'String'

Hi, I'm getting this error on v1.2.2:

E/flutter (16962): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: type 'FlutterError' is not a subtype of type 'String'
E/flutter (16962): #0      ProgressDialog.hide (package:progress_dialog/progress_dialog.dart:119:18)
E/flutter (16962): #1      restoreDataFromFile (package:my_grand_kids/managers/backups_manager.dart:427:33)

This is what I have on backups_manager.dart:427:
if (context != null) await pr.hide();
where pr is a ProgressDialog.

What could that be?

.update not working

Lib version : progress_dialog: ^1.2.0

Sample code:

void _onSavePressed() async {
    try {
      _progressDialog = ProgressDialog(context, isDismissible: false);
      _progressDialog.show();

      if (profilePictureFile != null) {
        _progressDialog.update(
          message: 'Uploading profile picture',
        );
        await _userRepository.uploadProfilePicture(profilePictureFile);
      }

      _user.fullName = _nameController.text;
      _user.phoneNumber = _phoneController.text;
      _user.email = _emailController.text;
      _progressDialog.update(
        message: 'Updating user data',
      );
      await _userRepository.editUserInFirestore(_user);
      print('_onSavePressed ${_user.id}');
      _progressDialog.hide();
    } catch (err) {
      print('err $err');
      _progressDialog.hide();
    }
  }

Output:

err setState() called in constructor: _BodyState#42577(lifecycle state: created, no widget, not mounted)
This happens when you call setState() on a State object for a widget that hasn't been inserted into the widget tree yet. It is not necessary to call setState() in the constructor, since the state is already assumed to be dirty when it is initially created.

Code is working if i comment _progressDialog.update() function

Feature: Use showCupertinoModalPopup when used on IOS

The progress dialog looks awesome on material apps on Material App, but looks little odd on Cupertino App for IOS.

Use showCupertinoModalPopup(), CupertinoAlertDialog and CupertinoActivityIndicator on IOS devices

The loading box does not disappear

Describe the bug
When I update to the latest version.
If I trigger multiple loading boxes at the same time, I use the hide() they will not disappear.
because it has no dismiss().

To Reproduce

request(BuildContext context) {
  ProgressDialog pr = ProgressDialog(context, type: ProgressDialogType.Normal);
  pr.show();

  // dio ...

  pr.hide();
}

Expected behavior
Should disappear

Smartphone (please complete the following information):

  • Device: iPhone7
  • OS: iOS.13.3.1
  • flutter
    Flutter 1.12.13+hotfix.9 • channel stable • [email protected]:flutter/flutter.git
    Framework • revision f139b11009 (3 weeks ago) • 2020-03-30 13:57:30 -0700
    Engine • revision af51afceb8
    Tools • Dart 2.7.2

hide method error

I encountered the problem of hide () method error reporting in the process of using it.
My code like this:

           pr.show();
           UserDao.login( _userName,_password).then((res) {
              pr.hide();
              if (res != null) {
                LocalStorage.save(Config.USER_NAME_KEY, _userName);
                LocalStorage.save(Config.PW_KEY, _password);
                NavigatorUtils.goHome(context);
             }
          });

But the error is as follows

E/flutter (32311): At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.

The hide method will be close lastest dialog instead of it.

Describe the bug
When the progress dialog is showing if I show my dialog then hide this progress dialog, that will be closed my dialog instead of progress dialog

Expected behavior
in this case, i want progress dialog closes itself and don't affect another dialog.

Smartphone (please complete the following information):

  • All devices.

Progress gif not showing - v1.2.1

Hi!! How r u?

The progress gif is not showing, e my log is printing this:
Unable to load asset: packages/progress_dialog/assets/double_ring_loading_io.gif

How i may proceed?

Progress Dialog not hidding after API call

Hey, nice package!
I can not hide the progress dialog after calling my API even isShowing = true,

But when I wrap the progressDialog.hide() with FutureDelayed 3 seconds, the dialog hidden after get my API call.

Custom Gif not working

Describe the bug
I'm downloading a gif from this url https://loading.io/, and added inside assets in my project ,it's showing spinner without animation. it's static.
Are @fayaz07 suggesting us how to implement custom animated progress bar or downloaded animated spinner(.gif). Because we need it for releasing the product app.
background of spinner has transparent,but it is also not showing transparent background
Spinner-1s-200px (1)

Allow to await for the dialog show

Problem statement
I use the progress dialog to keep the user informed of a blocking operation.
So the progress dialog must be showed and hidden after an operation, but if the operation is async but terminates very quickly, the dialog is not hidden, because the showDialog method (used internally in the .show()) does not have finished showing the dialog.

Describe the solution you'd like
I would like to be allow to await the .show() method, like this

ProgressDialog dialog = ...; 
await dialog.show();

// do some work ...

await dialog.hide();

Progress dialog is not show when invoke show method.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
I write some code like the following. It is for multi-platform. And the progress dialog is not show in android/web, however the dialog is show in windows platform.

class IndexPage extends StatefulWidget {
  IndexPage({Key key}) : super(key: key);

  @override
  _IndexPageState createState() => _IndexPageState();
}

// AutomaticKeepAliveClientMixin, see https://blog.csdn.net/a875801/article/details/92829950
// TickerProviderStateMixin, see https://blog.csdn.net/u011272795/article/details/82740389
class _IndexPageState extends State<IndexPage>
    with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
  List<Course> recommendCourses = [];
  List<Course> freeCourses = [];
  List<News> recommendNews = [];
  ProgressDialog pr;
  TabController _tabController;

  @override
  bool get wantKeepAlive => true;

  @override
  void initState() {
    print('Index, initState');
    pr = new ProgressDialog(context, showLogs: true);
    _tabController = TabController(length: categories.length, vsync: this);
    _updateState();
    super.initState();
  }

  @override
  void dispose() {
    print('Index, dispose');
    _tabController.dispose();
    super.dispose();
  }

  void _updateState() async {
    pr.show();
    print('pr.show()');
    var _recommendCourses = await CommonService().getRecommendCourses(3);
    var _freeCourses = await CommonService().getfreeCourses(2);
    var _recommendNews = await CommonService().getRecommendNews(3);
    print('_updateState: ${_recommendCourses}');
    setState(() {
      print('setState: ${_recommendCourses}');
      recommendCourses = _recommendCourses;
      freeCourses = _freeCourses;
      recommendNews = _recommendNews;
      pr.hide();
      print('pr.hide()');
    });
  }
  //...
}

Expected behavior
The dialog show as expected.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome 80

ProgressDialog CircularProgressIndicator stops animation when await future

Hi everybody. I have this problem with progressdailog: I have to load a big txt file (30mb) and I want to show the dialog till is loaded, but when I tap on the button the dialog starts showing and after 1 second the circularprogressindicator stops his animation; when the file is loaded (it takes almost 30 sec) the dialog hides correctly. How can I fix that?
Here is my code, the future:

Future<PatData> getPatData(String path) async { patData = await dataManager.getData(await file.readFile(path)); return patData; }

and the onTap:

pr.show().then((onValue) { getPatData(dataPath).then((value) { pr.hide(); Navigator.push( context, MaterialPageRoute( builder: (context) => GraphPage( patData: value, )), ); }); });

Can somebody help me?
Thank u!!!!

Has `dismiss()` been replaced from `hide()`?

I've updated the package version from v1.1.1 to 1.1.2.
This "bug fix" update broke my project because dismiss() method does not exist anymore and it is not reported on changelog. Should we use hide() now?
Thank you

Multiple progress dialog instance in a statefull widget

Describe the bug
I got strange condition if I have multiple progress dialog instance in a Statefull Widget, progress dialogs instantiate on build widget like this

progressDialog = new ProgressDialog(context,
        type: ProgressDialogType.Normal, isDismissible: true, showLogs: false)
      ..style(
        message: msg ?? "Memproses...",
        borderRadius: 8.0,
        backgroundColor: Colors.white,
        elevation: 5.0,
        messageTextStyle: TextStyle(fontSize: 16.0),
        // progressWidget: CircularProgressIndicator(),
      );
    progressDownloadDialog = new ProgressDialog(context,
        isDismissible: false, type: ProgressDialogType.Download)
      ..style(
        message: "Mendownload...",
        borderRadius: 8.0,
        backgroundColor: Colors.white,
        elevation: 5.0,
        messageTextStyle: TextStyle(fontSize: 16.0),
        progress: 0.0,
        maxProgress: 100,
        progressTextStyle: TextStyle(
            color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
   );

If I call progressDialog.show() or progressDownloadDialog.show(), the progressDownloadDialog will be triggered.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'make multiple instance progress dialog'
  2. Call on '.show()'
  3. See not properly showing

Expected behavior
I can use multiple ProgressDialog in a StatefullWidget

Screenshots
Not yet

Smartphone (please complete the following information):

  • Device: Pixel 3a
  • OS: Android
  • Version 10

Sample determinate LinearProgressIndicator

Is your feature request related to a problem? Please describe.
This is not a problem. More of a sample code.

Describe the solution you'd like
Your sample uses a Circle progress indicator. I hope you can also provide a LinearProgressIndicator that will simulate a determinate progress.

Describe alternatives you've considered
Tried to change the widget to linear but it appears beside the message. Would be nice if it is below the message. so an added option will be cool.

crashed in method hide()

After updating the flutter SDK to the latest version, thehide()method crashes. Specifically pointing to this line: Navigator.of(_context).pop();my code is exactly the same as the example, error reporting information is as follows:

NoSuchMethodError (NoSuchMethodError: The method 'ancestorStateOfType' was called on null.
Receiver: null
Tried calling: ancestorStateOfType(Instance of 'TypeMatcher<NavigatorState>'))

When changing Page, progress is closed instead of page change

I had a scenario where I forgot to close the progress dialog before navigating to a different page.
Instead of changing a page, Navigator only closed the progress dialog.

Since I have a big project where this issue can happen again I cannot let this behavior happen again.

Sorry, but I had to use a different progress dialog plugin.

Note: I am writing this so others know what they must be aware of with the current implementation of the plugin.

Progress Dialog Padding

Is there a way to add more padding between progressbar and loading text made to make it center.
please revert.

update after show causes widget not mounted crash

Using update method after show method causes the following crash error:
Unhandled Exception: setState() called in constructor: (lifecycle state: created, no widget, not mounted) This happens when you call setState() on a State object for a widget that hasn't been inserted into the widget tree yet. It is not necessary to call setState() in the constructor, since the state is already assumed to be dirty when it is initially created.

To Reproduce
Steps to reproduce the behavior:

  1. declare ProgressDialog and initialize in build
  2. show dialog
  3. update dialog
  4. hide dialog
  5. repeat steps 2-4 until it crashes

Progress dialog with no text

feature request

the progress diañog has no text or label, the width amd height shouñd resize to fit it.

in this case the dialog now becomes a square

Set Text On Existing Instance

Is your feature request related to a problem? Please describe.
Once i have created a progress dialog, there is no way to set the label.

Describe the solution you'd like
I am using this dialog to do more than 1 task so a way to be able to change the existing text would be nice.

Issue when await finishes quickly.

Its not working when trying to hide it in less than a second, whenComplete gets executed, but progress continues to show

I'm making Dio async call after pr.show(), when network failure Dio returns immediately, at this point pr.hide().whenComplete() is getting executed but progress dialog getting shown

Support for rtl / ltr

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Handle library with Bloc Library

Describe the bug
A clear and concise description of what the bug is.
First of all thank you so much @fayaz07 for published this great library.Really appreciated to you.
Now a days there is Bloc library is used for handling the state management, can you suggest us with one example where we are handle this library with Bloc Library. We need your example to support our production app.

Support dark theme

Can you please change the text hardcoded color value (Colors.black)?

Not sure, but you should probably pick some color from the theme...

Thanks

Dialog not dismissing

Why dialog not dismiss in catch block ?

Dialog able to dismiss in try, but not in catch.

 Future<List<ABC>> getData(BuildContext context) async {
    Response response;
    var list;

    var pr = ProgressLoadingDialog().showDialog(context);
    pr.show();

    try {
      response = await _service.getAll();
      var response = ABCResponse.fromJson(response.body);
      pr.dismiss();
            ....
      return list;
    } catch (e) {
      pr.dismiss();
         ...
      return list;
    }
  }

Then I replace pr.dismiss in catch to Navigator.of(context, rootNavigator: true).pop();, and it works! But when I back to previous page and want to push to this page again, I can't..

Crash when calling update method

First of all, thank you for your contribution.

Calling theupdatemethod immediately after theshowmethod is called will crash, although it may not be very common to use it like me, but you should deal with this bug.

Non-hardwired text style

This is a question of tastes, for sure, but I wouldn't hardwire the font color and size but would use what the platform provides instead, eg:

child: Text(_dialogMessage, style: Theme.of(context).textTheme.subhead),
child: Text("$_progress/100", style: Theme.of(context).textTheme.caption),
child: Text(message, textAlign: TextAlign.center, style: Theme.of(context).textTheme.subhead),

Bug crash app when call below build(BuildContext context)

Hello admin.

I use lib:

class UpdateAccountState extends State<UpdateAccount>{
ProgressDialog _progressDialog;
  @override
  Widget build(BuildContext context) {
    _progressDialog = ProgressDialog(context);
    _getUserInfo();
}

_getUserInfo() async {
  _progressDialog?.show();
 var userRe = await userRepo.find();
 if (_progressDialog.isShowing()) _progressDialog.hide();
}
}

App show error below.

**E/flutter (20452): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: setState() or markNeedsBuild() called during build.
E/flutter (20452): This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets.  A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
E/flutter (20452): The widget on which setState() or markNeedsBuild() was called was:
E/flutter (20452):   Overlay-[LabeledGlobalKey<OverlayState>#b9d5c]
E/flutter (20452): The widget which was currently being built when the offending call was made was:
E/flutter (20452):   UpdateAccount
E/flutter (20452): #0      Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:3704:11)
E/flutter (20452): #1      Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:3719:6)
E/flutter (20452): #2      State.setState (package:flutter/src/widgets/framework.dart:1161:14)
E/flutter (20452): #3      OverlayState.insertAll (package:flutter/src/widgets/overlay.dart:346:5)
E/flutter (20452): #4      OverlayRoute.install (package:flutter/src/widgets/routes.dart:43:24)
E/flutter (20452): #5      TransitionRoute.install (package:flutter/src/widgets/routes.dart:180:11)
E/flutter (20452): #6      ModalRoute.install (package:flutter/src/widgets/routes.dart:923:11)
E/flutter (20452): #7      NavigatorState.push (package:flutter/src/widgets/navigator.dart:1789:11)
E/flutter (20452): #8      showGeneralDialog (package:flutter/src/widgets/routes.dart:1582:53)
E/flutter (20452): #9      showDialog (package:flutter/src/material/dialog.dart:697:10)
E/flutter (20452): #10     ProgressDialog.show (package:progress_dialog/progress_dialog.dart:129:7)
E/flutter (20452): #11     UpdateAccountState._getUserInfo (package:htsv/screen/account.dart:37:22)
E/flutter (20452): <asynchronous suspension>
E/flutter (20452): #12     UpdateAccountState.build (package:htsv/screen/account.dart:60:5)
E/flutter (20452): #13     StatefulElement.build (package:flutter/src/widgets/framework.dart:4064:27)
E/flutter (20452): #14     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3958:15)
E/flutter (20452): #15     Element.rebuild (package:flutter/src/widgets/framework.dart:3755:5)
E/flutter (20452): #16     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3941:5)
E/flutter (20452): #17     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4111:11)
E/flutter (20452): #18     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3936:5)
E/flutter (20452): #19     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
E/flutter (20452): #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
E/flutter (20452): #21     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5165:14)
E/flutter (20452): #22     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
E/flutter (20452): #23     Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
E/flutter (20452): #24     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3978:16)
E/flutter (20452): #25     Element.rebuild (package:flutter/src/widgets/framework.dart:3755:5)
E/flutter (20452): #26     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3941:5)
E/flutter (20452): #27     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3936:5)
E/flutter (20452): #28     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
E/flutter (20452): #29     Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
E/flutter (20452): #30     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5165:14)
E/flutter (20452): #31     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
E/flutter (20452): #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
E/flutter (20452): #33     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5165:14)
E/flutter (20452): #34     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3109:14)
E/flutter (20452): #35     Element.updateChild (package:flutter/src/widgets/framework.dart:2903:12)
E/flutter (20452): #36     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3978:16)
E/flutter (20452): #37     Element.rebuild (package:flutter/src/widgets/framework.dart:3755:5)
E/flutter (20452): #38     ComponentElement._firstBuild (package:flutter/src/wi

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#15264](dirty, state: _OverlayEntryState#12763):
The method 'drive' was called on null.
Receiver: null
Tried calling: drive<Color>(Instance of '_ChainedEvaluation<Color>')

User-created ancestor of the error-causing widget was: 
  MaterialApp file:///main.dart:18:12
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      ModalRoute._buildModalBarrier (package:flutter/src/widgets/routes.dart:1243:48)
#2      _OverlayEntryState.build (package:flutter/src/widgets/overlay.dart:170:25)
#3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4064:27)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3958:15)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by widgets library ═══════════════════════════════════════════════════
'package:flutter/src/animation/animations.dart': Failed assertion: line 376 pos 15: 'parent != null': is not true.
User-created ancestor of the error-causing widget was: 
  MaterialApp file:main.dart:18:12
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
The method 'drive' was called on null.
Receiver: null
Tried calling: drive<Color>(Instance of '_ChainedEvaluation<Color>')*

a ProgressDialogType.Download bug for 1.2.3

just 1.2.3

test code:

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

class ProgressPage extends StatefulWidget {
  @override
  _ProgressPageState createState() => _ProgressPageState();
}

class _ProgressPageState extends State<ProgressPage> {

  @override
  Widget build(BuildContext context) {
    ProgressDialog pr =ProgressDialog(
        context,
        type: ProgressDialogType.Download
    );
    pr.style(
//      message: 'Downloading file...',
      message:
      'Lets dump some huge text into the progress dialog and check whether it can handle the huge text. If it works then not you or me, flutter is awesome',
    );
    return  Scaffold(
      appBar: AppBar(
        title: Text("progress"),
      ),
      body: ListView.builder(
        padding: new EdgeInsets.all(15.0),
        itemExtent: 50.0,
        itemBuilder: (BuildContext context,int index){
          return  InkWell(
            onTap: (){
              pr.show();
            },
            child: Text("content: $index"),
          );
        },
      ),
    );
  }
}

error:

I/flutter ( 4108): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 4108): The following assertion was thrown during performLayout():
I/flutter ( 4108): RenderFlex children have non-zero flex but incoming height constraints are unbounded.
I/flutter ( 4108): When a column is in a parent that does not provide a finite height constraint, for example if it is
I/flutter ( 4108): in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
I/flutter ( 4108): flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining
I/flutter ( 4108): space in the vertical direction.
I/flutter ( 4108): These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child
I/flutter ( 4108): cannot simultaneously expand to fit its parent.
I/flutter ( 4108): Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible
I/flutter ( 4108): children (using Flexible rather than Expanded). This will allow the flexible children to size
I/flutter ( 4108): themselves to less than the infinite remaining space they would otherwise be forced to take, and
I/flutter ( 4108): then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum
I/flutter ( 4108): constraints provided by the parent.
I/flutter ( 4108): If this message did not help you determine the problem, consider using debugDumpRenderTree():
I/flutter ( 4108):   https://flutter.dev/debugging/#rendering-layer
I/flutter ( 4108):   http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
I/flutter ( 4108): The affected RenderFlex is:
I/flutter ( 4108):   RenderFlex#47123 relayoutBoundary=up9 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE(creator: Column ← Padding ← Expanded ← Row ← Column ← Padding ← Container ← _Body ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#95448 ink renderer] ← NotificationListener<LayoutChangedNotification> ← ⋯, parentData: offset=Offset(0.0, 0.0) (can use size), constraints: BoxConstraints(w=404.0, 0.0<=h<=Infinity), size: MISSING, direction: vertical, mainAxisAlignment: start, mainAxisSize: min, crossAxisAlignment: center, verticalDirection: down)
I/flutter ( 4108): The creator information is set to:
I/flutter ( 4108):   Column ← Padding ← Expanded ← Row ← Column ← Padding ← Container ← _Body ← DefaultTextStyle ←
I/flutter ( 4108):   AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#95448 ink renderer] ←
I/flutter ( 4108):   NotificationListener<LayoutChangedNotification> ← ⋯
I/flutter ( 4108): The nearest ancestor providing an unbounded width constraint is: RenderFlex#7321c relayoutBoundary=up6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
I/flutter ( 4108):   creator: Column ← Padding ← Container ← _Body ← DefaultTextStyle ← AnimatedDefaultTextStyle ←
I/flutter ( 4108):     _InkFeatures-[GlobalKey#95448 ink renderer] ← NotificationListener<LayoutChangedNotification> ←
I/flutter ( 4108):     CustomPaint ← _ShapeBorderPaint ← PhysicalShape ← _MaterialInterior ← ⋯
I/flutter ( 4108):   parentData: offset=Offset(0.0, 0.0) (can use size)
I/flutter ( 4108):   constraints: BoxConstraints(264.0<=w<=504.0, 0.0<=h<=838.0)
I/flutter ( 4108):   size: MISSING
I/flutter ( 4108):   direction: vertical
I/flutter ( 4108):   mainAxisAlignment: start
I/flutter ( 4108):   mainAxisSize: min
I/flutter ( 4108):   crossAxisAlignment: center
I/flutter ( 4108):   verticalDirection: down
I/flutter ( 4108): See also: https://flutter.dev/layout/
I/flutter ( 4108): If none of the above helps enough to fix this problem, please don't hesitate to file a bug:
I/flutter ( 4108):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 4108): 
I/flutter ( 4108): The relevant error-causing widget was:
I/flutter ( 4108):   Column
I/flutter ( 4108):   file:///E:/flutter_src/flutter_windows_v1.12.13+hotfix.5-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/progress_dialog-1.2.3/lib/progress_dialog.dart:225:36
I/flutter ( 4108): 
I/flutter ( 4108): When the exception was thrown, this was the stack:
I/flutter ( 4108): #0      RenderFlex.performLayout.<anonymous closure> (package:flutter/src/rendering/flex.dart:691:11)
I/flutter ( 4108): #1      RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:718:10)
I/flutter ( 4108): #2      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #3      RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
I/flutter ( 4108): #4      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #5      RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:806:17)
I/flutter ( 4108): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #7      RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:744:15)
I/flutter ( 4108): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #9      RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
I/flutter ( 4108): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #11     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #13     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #15     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #16     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
I/flutter ( 4108): #17     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #18     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
I/flutter ( 4108): #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #20     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:392:13)
I/flutter ( 4108): #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #22     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
I/flutter ( 4108): #23     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #24     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)
I/flutter ( 4108): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #26     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #28     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #30     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #32     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #33     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #34     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #35     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #36     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #37     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #38     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter ( 4108): #39     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3168:13)
I/flutter ( 4108): #40     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter ( 4108): #41     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:505:15)
I/flutter ( 4108): #42     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
I/flutter ( 4108): #43     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
I/flutter ( 4108): #44     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
I/flutter ( 4108): #45     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
I/flutter ( 4108): #46     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
I/flutter ( 4108): #47     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
I/flutter ( 4108): #48     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1041:9)
I/flutter ( 4108): #49     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:957:5)
I/flutter ( 4108): #53     _invoke (dart:ui/hooks.dart:259:10)
I/flutter ( 4108): #54     _drawFrame (dart:ui/hooks.dart:217:3)
I/flutter ( 4108): (elided 3 frames from package dart:async)
I/flutter ( 4108): 
I/flutter ( 4108): The following RenderObject was being processed when the exception was fired: RenderFlex#47123 relayoutBoundary=up9 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
I/flutter ( 4108):   creator: Column ← Padding ← Expanded ← Row ← Column ← Padding ← Container ← _Body ← DefaultTextStyle
I/flutter ( 4108):     ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#95448 ink renderer] ←
I/flutter ( 4108):     NotificationListener<LayoutChangedNotification> ← ⋯
I/flutter ( 4108):   parentData: offset=Offset(0.0, 0.0) (can use size)
I/flutter ( 4108):   constraints: BoxConstraints(w=404.0, 0.0<=h<=Infinity)
I/flutter ( 4108):   size: MISSING
I/flutter ( 4108):   direction: vertical
I/flutter ( 4108):   mainAxisAlignment: start
I/flutter ( 4108):   mainAxisSize: min
I/flutter ( 4108):   crossAxisAlignment: center
I/flutter ( 4108):   verticalDirection: down
I/flutter ( 4108): This RenderObject had the following descendants (showing up to depth 5):
I/flutter ( 4108):     child 1: RenderConstrainedBox#e379d relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 4108):     child 2: RenderFlex#17729 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108):       child 1: RenderParagraph#27a5d NEEDS-LAYOUT NEEDS-PAINT
I/flutter ( 4108):         text: TextSpan
I/flutter ( 4108):     child 3: RenderConstrainedBox#494d2 NEEDS-LAYOUT NEEDS-PAINT
I/flutter ( 4108):     child 4: RenderPositionedBox#f2113 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108):       child: RenderParagraph#d9650 NEEDS-LAYOUT NEEDS-PAINT
I/flutter ( 4108):         text: TextSpan
I/flutter ( 4108): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderFlex#47123 relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderPadding#d58fb relayoutBoundary=up8 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderFlex#f2aa0 relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderFlex#7321c relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderPadding#0e61f relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: _RenderInkFeatures#34484 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderCustomPaint#dbdd6 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#c15eb relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
I/flutter ( 4108): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 321 pos 12: 'child.hasSize': is not true.
I/flutter ( 4108): Another exception was thrown: RenderBox was not laid out: RenderPhysicalShape#c15eb relayoutBoundary=up2

The _dismissingContext is null

Error

E/flutter (14884): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'focusScopeNode' was called on null.
E/flutter (14884): Receiver: null
E/flutter (14884): Tried calling: focusScopeNode

Future<bool> hide() {
    if (_isShowing) {
      try {
        _isShowing = false;
        Navigator.of(_dismissingContext).pop(true);
        if (_showLogs) debugPrint('ProgressDialog dismissed');
        return Future.value(true);
      } catch (_) {
        return Future.value(false);
      }
    } else {
      if (_showLogs) debugPrint('ProgressDialog already dismissed');
      return Future.value(false);
    }
  }

the _dismissingContext context is always null
the _dismissingContext should be initialized

Parameter for text align

I am having issues when I am using some specific strings (e.g. "Updating queue number...") as progress messages where it turns out to be weird looking because of some weird text alignment. (See attached pic)
Screenshot_20200130-224335

I checked the code and it confirmed that it was using justify text alignment.
Text(_dialogMessage, textAlign: TextAlign.justify, style: _messageStyle)

I hope you can add an optional parameter for setting the text alignment so I can easily adjust it accordingly.

Thanks! :)

progressDialog not hide

Hello admin. I user lib After Layout
Please see code

class UpdateAccountState extends State<UpdateAccount>
    with AfterLayoutMixin<UpdateAccount> {
ProgressDialog _progressDialog;
  @override
  void afterFirstLayout(BuildContext context) {
    _progressDialog = ProgressDialog(context);
    _getUserInfo();
  }
}

  _getUserInfo() async {
    _progressDialog?.show();
    var userRe = await userRepo.find();
    getInfoUser(userRe).then((user) {
      print("pr show? ${_progressDialog.isShowing()}");
      if (_progressDialog.isShowing()) _progressDialog.hide();
    }).catchError((error) {
      if (_progressDialog.isShowing()) _progressDialog.hide();
    });
  }

print("pr show? ${_progressDialog.isShowing()}"); return false => progressDialog not hide. Please help me fix.

ProgressDialog won't show again when coming back from a previous screen.

Describe the bug
Screen with ProgressDialog loading a content, after the content loads, the ProgressDialog is hidden and it moves to the next screen, when you pop back to that screen, and when you try to show the ProgressDialog again, it doesn't show.

Expected behavior
Should show without error

Log
flutter: Exception while showing the dialog [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'FlutterError' is not a subtype of type 'String' #0 ProgressDialog.show (package:progress_dialog/progress_dialog.dart:160:18) #1 _ProjectMapPageState.routeTraffic (package:signtracker/feature/project/maps/project_map_page.dart:469:8) #2 _ProjectMapPageState.build.<anonymous closure> (package:signtracker/feature/project/maps/project_map_page.dart:316:46) #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14) #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36) #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11) #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5) #8 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7) #9 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:467:9) #10 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) #11 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:117:9) #12 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) #13 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18) #14 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7) #15 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) #16 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) #17 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) #18 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) #19 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) #20 _rootRunUnary (dart:async/zone.dart:1138:13) #21 _CustomZone.runUnary (dart:async/zone.dart:1031:19) #22 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7) #23 _invoke1 (dart:ui/hooks.dart:273:10) #24 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)

Smartphone (please complete the following information):

Device: iPhone5s
OS: iOS.12
flutter
Flutter 1.12.13+hotfix.9 • channel stable • [email protected]:flutter/flutter.git
Framework • revision f139b11009 (3 weeks ago) • 2020-03-30 13:57:30 -0700
Engine • revision af51afceb8
Tools • Dart 2.7.2

not work

i tried , but not work.
show me this error:ackage:pub/src/solver/version_solver.dart VersionSolver._result
This is an unexpected error. Please run

pub --trace --verbosity=warning get --no-precompile

and include the logs in an issue on https://github.com/dart-lang/pub/issues/new

pub get failed (1)
exit code 1

Disable close dialog by back button option

I know there is an option to barrierDismissible, but it only prevents tap on the screen, if the back button got tapped, the dialog is closed. Is there any option that makes back button disabled when the dialog show up? Btw this plugin is really awesome :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.