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.

Last update: Jan 21, 2022

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/

GitHub

https://github.com/fayaz07/progress_dialog/
Comments
  • 1. 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

    Reviewed by rhyscoronado at 2020-04-22 12:53
  • 2. 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!!!!

    Reviewed by bobosette at 2020-04-09 09:37
  • 3. 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
    Reviewed by zmabies at 2019-10-24 14:36
  • 4. 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
    
    
    Reviewed by ghost at 2020-05-22 07:11
  • 5. 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.

    Reviewed by bagus-repository at 2019-10-31 13:45
  • 6. .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

    Reviewed by mychaelgo at 2019-09-16 08:18
  • 7. Progress dialog is not hiding on catchError

    i want to show progress dialog on before of API call .while calling API if there is any error occurred i wants to hide the dialog on CatchError function

    Reviewed by nikhilvc at 2019-12-02 07:07
  • 8. Download progress decimal places pattern

    Is your feature request related to a problem? Please describe. I need to change the predefined progress text when using . When displaying the ProgressDialogType.Download, I don't like the fact that that progress shows its complete value. For example: 1/100.0 1.3276872287/100.0 3.82738/100.0

    I guess it would be nice to have some way to make it follow a pattern.

    Describe the solution you'd like Two parameters in the constructor to allow defining the decimal places of the current progress (progressDecimalPlaces) and max progress (maxProgressDecimalPlaces).

    downloadDialog ??= ProgressDialog(
        context,
        type: ProgressDialogType.Download,
        progressDecimalPlaces: [int],
        maxProgressDecimalPlaces: [int],
      );
    

    Some examples: progressDecimalPlaces: 0 | maxProgressDecimalPlaces: 0 -> 4/100 progressDecimalPlaces: 0 | maxProgressDecimalPlaces: 2 -> 4/100.00 progressDecimalPlaces: 2 | maxProgressDecimalPlaces: 0 -> 4.25/100 progressDecimalPlaces: 2 | maxProgressDecimalPlaces: 2 -> 4.25/100.00

    To allow the default user/dart double.toString() pass -1 as value:

    downloadDialog ??= ProgressDialog(
        context,
        type: ProgressDialogType.Download,
        progressDecimalPlaces: -1,
        maxProgressDecimalPlaces: -1,
      );
    

    This would result in the normal behaviour of the lib today: 1.3276872287/100.0

    Reviewed by fernando-s97 at 2020-08-13 19:58
  • 9. 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 • git[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
    Reviewed by lqk9511 at 2020-04-22 11:42
  • 10. 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
    Reviewed by liudonghua123 at 2020-03-26 07:30
  • 11. Bug on hide

    Describe the bug I have issue when try to hide progress dialog. It's always showing if distance between show and hide is fast

    To Reproduce Steps to reproduce the behavior: 1.show progress dialog 2.try without delay then hide

    Expected behavior progress dialog should be hide

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

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: All
    Reviewed by Lzyct at 2020-07-03 12:16
  • 12. How to change the progressWidget size?

    I'm currently trying to make a progress dialog for the signing up process.

    loadingDialog.style( message: "Signing up...", backgroundColor: Colors.grey[900], progressWidget: CircularProgressIndicator(), padding: EdgeInsets.all(20), elevation: 10.0, borderRadius: 3.0, messageTextStyle: TextStyle(color: Colors.white, fontSize: 21) );

    Everything works fine. But the CircularProgressIndicator is too big and looks kinda odd. Is there any ways to change the size of it?

    Screenshot : https://imgur.com/a/xpu6uAH

    Reviewed by buckydroid at 2020-10-27 07:20
  • 13. Dialog not being hid after dispose() being called

    My code is roughly the following:

    await progressDialog.show(); // (1)
    await callExternalApi(); // (2)
    await progressDialog.hide(); // (3) 
    

    Between (2) and (3), the ProgressDialog dismissed by back button log was shown, but the callExternalApi does nothing but calling an external API (and, well, I did not press the back button). Besides, the dialog was not dismissed. It also involves a Provider, but I don't think that's relevant. I looked up the code of this lib, and noticed that the log is shown in the dispose method of the _BodyState class, but that method does not call Navigator.pop. As a temporary workaround, I'm doing the following:

    await progressDialog.show(); 
    await callExternalApi(); 
    if(progressDialog.isShowing()) {
        await progressDialog.hide();
    } else{
        Navigator.pop(dialogContext);
    }
    

    but it is far from ideal. I have no idea why the dispose method of _BodyState was called.

    Reviewed by jjosenaldo at 2020-09-15 00:53
  • 14. Added message text to constructor

    If I want to make a simple progress dialog with some text, I can't do that without creating, then styling the dialog (two steps that could be one). In this change,

    To fix this, I added the message property to the constructor so I can do both in a single call:

     pr = ProgressDialog(
      context,
      type: ProgressDialogType.Normal, 
      message: 'This is my message',
      isDismissible: false,
    );
    

    What's this PR do?

    Makes it so you can set the message in the constructor.

    Reviewed by johnwargo at 2020-08-15 14:21
  • 15. Dynamically update not working well

    Describe the bug ProgressDialogType.Download , show/hide works well. When use pr.update, the process is stopped and dialog is showing.

    To Reproduce

    await dio.download(
          downloadUrl,
          savePath,
          onReceiveProgress: (rcv, total) {
            print('received: ${rcv.toStringAsFixed(0)} out of total: ${total.toStringAsFixed(0)}');
    
            setState(() {
              progress = ((rcv / total) * 100 * 10).roundToDouble() / 10;
              print('progress:$progress');
            });
    
            pr.update(progress: progress, message: "Downloading file...");   // <-- this code not working
    
            if (progress == 100.0) {
              setState(() {
                isDownloaded = true;
              });
            } else if (progress < 100.0) {}
          },
          deleteOnError: true,
        );
    

    Expected behavior progress text will be updated

    Smartphone:

    • Device: [iPhoneX Max]
    • OS: [iOS13.6]
    Reviewed by zhangli-jerry at 2020-08-06 08:55
  • 16. Multiple dialogs on multiple Routes

    Working example for problem:

        import 'package:flutter/material.dart';
        import 'package:progress_dialog/progress_dialog.dart';
        
        void main() => runApp(MyApp());
        
        class MyApp extends StatelessWidget {
        
            @override
            Widget build(BuildContext context) {
                return MaterialApp(
                        title: 'Flutter Demo',
                        theme: ThemeData(
                            primarySwatch: Colors.blue,
                        ),
                        home: ParentWidget()
                );
            }
        }
        
        class ParentWidget extends StatelessWidget {
            @override
            Widget build(BuildContext context) {
                return Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                        Text("PatentWidget"),
                        RaisedButton(
                            child: Text("start child 1"),
                            onPressed: () async{
                                ProgressDialog progressDialog = ProgressDialog(
                                    context,
                                    type: ProgressDialogType.Normal,
                                    isDismissible: true,
                                );
                                progressDialog.show();
                                await new Future.delayed(const Duration(seconds : 1)); // simulate loading
                    await Navigator.push(
                        context, MaterialPageRoute <dynamic>(
                            builder: (context) => Child1Widget()
                      )
                    );
                    progressDialog.hide();
                  }
                        ),
        
                    ],
                );
            }
        }
        
        class Child1Widget extends StatelessWidget {
            @override
            Widget build(BuildContext context) {
                return Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                        Text("Child1Widget"),
                        RaisedButton(
                            child: Text("start child 2"),
                            onPressed: () async{
                                ProgressDialog progressDialog = ProgressDialog(
                                    context,
                                    type: ProgressDialogType.Normal,
                                    isDismissible: true,
                                );
                                progressDialog.show();
                                await new Future.delayed(const Duration(seconds : 1)); // simulate loading
                                await Navigator.push(
                                        context, MaterialPageRoute <dynamic>(
                                            builder: (context) => Child2Widget()
                                    )
                                );
                                progressDialog.hide();
                            },
                        ),
                        RaisedButton(
                                child: Text("back to parent"),
                                onPressed: () {
                                    Navigator.of(context).pop();
                                }
                        )
                    ],
                );
            }
        }
        
        class Child2Widget extends StatelessWidget {
            @override
            Widget build(BuildContext context) {
                return Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                        Text("Child2Widget"),
                        RaisedButton(
                                child: Text("back to child 1"),
                                onPressed: () {
                                    Navigator.of(context).pop();
                                }
                        )
                    ],
                );
            }
        }
    
    

    ParentWidget -> Child1Widget and back works properly

    ParentWidget -> Child1Widget -> Child2Widget:

    1. Child1Widget -> Child2Widget - no dialog
    2. Child2Widget -> Child1Widget -> ParentWidget - dialog on ParentWidget cannot be removed
    Reviewed by richardkrieger at 2020-08-02 08:38
  • 17. added option for autoHide Duration

    What's this PR do?

    added option for autoHide Duration

    Where should the reviewer start?

    Mention the files where the reviewer have to review, line numbers or section will be more helpful

    Screenshots (if appropriate)

    Any other suggestions/queries:

    Add your queries/suggestions here

    Reviewed by zeusbaba at 2020-07-21 18:29

Related

Progress State Button - A customizable progress button for Flutter
Progress State Button - A customizable progress button for Flutter

Progress State Button - A customizable progress button for Flutter

Jul 27, 2022
A Flutter package for a quick and handy giffy dialog.
A Flutter package for a quick and handy giffy dialog.

?? Giffy Dialogs A beautiful and custom alert dialog for flutter highly inspired from FancyAlertDialog-Android. The source code is 100% Dart, and ever

Aug 7, 2022
A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations.
A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations.

flutter_animated_dialog A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations. Dialog barrier i

Apr 4, 2022
A liquid progress indicator for Flutter
A liquid progress indicator for Flutter

liquid_progress_indicator Liquid progress indicator for Flutter. Features Liquid circular progress indicator. Liquid linear progress indicator. Liquid

Jul 22, 2022
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.

like_button Language: English | 中文简体 Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's h

Aug 10, 2022
App to choose a random TV show episode - Made with #Flutter
App to choose a random TV show episode - Made with #Flutter

TV Randshow - App to choose a random TV show episode About the project TV Randshow was created to help choose a random episode from your favorites TV

Jul 23, 2022
Shimmer loading - A Flutter project to show how to add shimmer loading animation
Shimmer loading - A Flutter project to show how to add shimmer loading animation

shimmer_loading A Flutter project to show how to add shimmer loading animation.

Feb 6, 2022
Flutter's core Dropdown Button widget with steady dropdown menu and many options you can customize to your needs.
Flutter's core Dropdown Button widget with steady dropdown menu and many options you can customize to your needs.

Flutter DropdownButton2 Intro Flutter's core Dropdown Button widget with steady dropdown menu and many options you can customize to your needs. Featur

Aug 2, 2022
Add an indicator for a progression. You can customize indicators (shape, color, ..)
Add an indicator for a progression. You can customize indicators (shape, color, ..)

dots_indicator Widget to display dots indicator to show a position (for a PageView for example). Installation You just need to add dots_indicator as a

Aug 2, 2022
In this repo you can expertise how to build various User Interface in Flutter
In this repo you can expertise how to build various User Interface in Flutter

?? Flutter UI ?? Introduction The language used here is Dart, which is a object oriented programming language with the sdk called Flutter,It's a googl

Jun 17, 2022
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.

Motion Tab Bar A beautiful animated widget for your Flutter apps Preview: | | Getting Started Add the plugin: dependencies: motion_tab_bar: ^0.1.5 B

Jul 28, 2022
Easily add staggered animations to your ListView, GridView, Column and Row children.
Easily add staggered animations to your ListView, GridView, Column and Row children.

Flutter Staggered Animations Easily add staggered animations to your ListView, GridView, Column and Row children as shown in Material Design guideline

Aug 12, 2022
A Flutter widget that easily adds the flipping animation to any widget
A Flutter widget that easily adds the flipping animation to any widget

flip_card A component that provides a flip card animation. It could be used for hiding and showing details of a product. How to use import 'package:fl

Aug 9, 2022
A small splashscreen used as intro for flutter applications easily with a lot of customizations ❤️🥳
A small splashscreen used as intro for flutter applications easily with a lot of customizations ❤️🥳

Splash Screen A splashscreen package to be used for an intro for any flutter application easily with a lot of customization Currently Supported by awe

Jul 26, 2022
A Flutter package for easily implementing Material Design navigation transitions.
A Flutter package for easily implementing Material Design navigation transitions.

Morpheus A Flutter package for easily implementing Material Design navigation transitions. Examples Parent-child transition You can use MorpheusPageRo

Jul 6, 2022
Fade animation - Add fade animation to your app easily
Fade animation - Add fade animation to your app easily

fade_animation Add fade animation to your app easily using simple_animations pac

Jan 28, 2022
A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.
A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

Jul 20, 2022
Load and get full control of your Rive files in a Flutter project using this library.
Load and get full control of your Rive files in a Flutter project using this library.

⚠️ Please migrate to the new Rive Flutter runtime. This runtime is for the old Rive (formerly Flare) and will only receive updates for breaking issues

Aug 8, 2022
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).

drawing_animation From static SVG assets See more examples in the showcasing app. Dynamically created from Path objects which are animated over time m

Aug 3, 2022