fayaz07 / progress_dialog

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.

Home Page:https://fayaz07.github.io/progress_dialog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a ProgressDialogType.Download bug for 1.2.3

opened this issue · comments

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

can you please use the latest flutter version

can you please use the latest flutter version

my use flutter v1.12.13+hotfix.5 and v1.17.1 , Both errors occurred in version 1.2.3

can you please use the latest flutter version

I encountered the same problem, and my flutter version is the latest.

Same here, just ping me if I can help you out with debugging.
Works perfectly fine with 1.2.2

Same here, but version 1.2.2 the error persists.

Same error :((

can someone give me a piece of code to reproduce this issue

I found the same error today, espically when I use the ProgressDialogType.Download ,So I change it to ProgressDialogType.Normal, I think maybe we use the ListView cause this error, because the total height is dynamic .

my code as below :

 pr = ProgressDialog(context,
        type: ProgressDialogType.Normal, isDismissible: false, showLogs: true);

await dio.download(link, path, onReceiveProgress: (rec, total) {
        downloadingRate = rec / total;
        downloadingRateString =
            "Downloading ..." + ((rec / total) * 100).toStringAsFixed(0) + "%";
        pr.update(message: downloadingRateString);
      });

Sorry guys, actually I was involved in some other stuff, I will resolve this asap. Thanks a ton all of you!