Flutter list view - An unofficial list view for flutter

Overview

Flutter List View

I don't like official list view. There are some features don't provide and jumpTo performance is not good. I rewrite the list supported these features in [Features] sections

Features

  1. Support jump to index
    Jump to index is not support in listview. But it is useful function
  2. Support keep position
    If some data insert before other items, It will scroll down. Some chat software may want to keep the position not scroll down when new message coming.
  3. Support show top in reverse mode if the data can't fill full viewport.
  4. Support header sticky
  5. Support integrate pull_to_refresh
  6. Support scroll to specify index when initialize data
  7. Performance
    When listview jump to somewhere, The items which layout before the position will always loaded. It is not realy lazy loading.

Screen

Example

FlutterListView(
      delegate: FlutterListViewDelegate(
    (BuildContext context, int index) =>
        ListTile(title: Text('List Item ${data[index]}')),
    childCount: data.length,
  ))

Jump to index

flutterListViewController.jumpToIndex(100);

OR

/// Declare
FlutterListViewController controller = FlutterListViewController();
...
controller.sliverController
                      .jumpToIndex(100);
...
FlutterListView(
  controller: controller,
  delegate: FlutterListViewDelegate(
    (BuildContext context, int index) => Container(
      color: Colors.white,
      child: ListTile(title: Text('List Item ${data[index]}')),
    ),
    childCount: data.length,
  ))

If you want better user expierence, preferItemHeight or onItemHeight may set to.

  • preferItemHeight The package don't know the item's height, If you don't set, package alway think the item height is 50 util layout the item. If you know the height, you should set it.
  • onItemHeight like preferItemHeight, the function will used to get height of each item util the item layout.

Keep Position

_renderList() {
  return FlutterListView(
      reverse: true,
      delegate: FlutterListViewDelegate(
          (BuildContext context, int index) => Align(
                alignment: Alignment.centerRight,
                child: Padding(
                  padding: const EdgeInsets.all(10.0),
                  child: Container(
                    decoration: const BoxDecoration(
                        color: Colors.blue,
                        borderRadius: BorderRadius.only(
                            topLeft: Radius.circular(20),
                            bottomLeft: Radius.circular(20),
                            bottomRight: Radius.circular(20))),
                    child: Padding(
                      padding: const EdgeInsets.all(10.0),
                      child: Text(
                        chatListContents[index].msg,
                        style: const TextStyle(
                            fontSize: 14.0, color: Colors.white),
                      ),
                    ),
                  ),
                ),
              ),
          childCount: chatListContents.length,
          onItemKey: (index) => chatListContents[index].id.toString(),
          keepPosition: true,
          keepPositionOffset: 80,
          firstItemAlign: FirstItemAlign.end));
}

Notice: Keep positoin need implement onItemKey, the onItemKey used to identify the unique of item. The key should difference with other items' key. We use the key to know what position you insert to current list. if you insert a item before the rendered item, package should increase the scrollOffset.

Sticky header

Widget _renderHeader(String text) {
  return Container(
    color: const Color(0xFFF3F4F5),
    child: Padding(
      padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
      child: Text(
        text,
        style: const TextStyle(fontSize: 18, color: Color(0xFF767676)),
      ),
    ),
  );
}

Widget _renderItem(CountryModel itemData) {
  return Padding(
      padding: const EdgeInsets.only(right: 12.0),
      child: ListTile(
          title: Text(itemData.name), trailing: Text(itemData.phoneCode)));
}

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: const Text("Stick Header")),
    body: FlutterListView(
        delegate: FlutterListViewDelegate(
          (BuildContext context, int index) {
            var data = _countries[index];
            if (data is AlphabetHeader) {
              return _renderHeader(data.alphabet);
            } else {
              return _renderItem(data as CountryModel);
            }
          },
          childCount: _countries.length,
          onItemSticky: (index) => _countries[index] is AlphabetHeader,
        ),
        controller: controller),
  );
}

You can also check doc/stickyHeader.md

Integrate pull_to_refresh

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: const Text("Intergrate pull to refresh in list"),
    ),
    body: SmartRefresher(
      enablePullDown: true,
      enablePullUp: true,
      header: const WaterDropHeader(),
      footer: CustomFooter(
        builder: (context, mode) {
          Widget body;
          if (mode == LoadStatus.idle) {
            body = const Text("pull up load");
          } else if (mode == LoadStatus.loading) {
            body = const CupertinoActivityIndicator();
          } else if (mode == LoadStatus.failed) {
            body = const Text("Load Failed!Click retry!");
          } else if (mode == LoadStatus.canLoading) {
            body = const Text("release to load more");
          } else {
            body = const Text("No more Data");
          }
          return SizedBox(
            height: 55.0,
            child: Center(child: body),
          );
        },
      ),
      controller: _refreshController,
      onRefresh: _onRefresh,
      onLoading: _onLoading,
      child: FlutterListView(
          delegate: FlutterListViewDelegate(
        (BuildContext context, int index) =>
            ListTile(title: Text('List Item ${data[index]}')),
        childCount: data.length,
      )),
    ),
  );
}
Comments
  • Restoring scroll position not reliable

    Restoring scroll position not reliable

    Hello all. Most of flutter_list_view works fine, but I have the following problem:

    In my app, there is a list of chat messages that are rendered as HTML using flutter_html. Each message can have its own height, which I can't set myself.

    When I try to initialize the list with initIndex and initOffset, sometimes the scroll position is just wrong. This depends on the preferItemHeight value. If I set a small value, the scroll position is fine when there are only single-line messages, but breaks for large messages. If a large value is set, the scroll position is fine when there are large values, but has problems when there are many one-line items.

    It seems that the initial scroll position is restored with preferItemHeight or onItemHeight(...), just before the actual height of the item is known.

    I tried to create a reproducible example, but was not able to create this behavior with test data.

    Code I can currently share:

    FlutterListView(
          key: ObjectKey(...),
          controller: viewController,
          delegate: FlutterListViewDelegate(
            (BuildContext context, int index) {
             ...
              return Container(
                // container is required, otherwise there will be layouting errors
                child: XXX(),
              );
            },
            onItemKey: (index) {
             ...
            },
            onItemHeight: (index) {
             ...
            },
            childCount: itemCount,
            initIndex: initialScrollIndex,
            initOffset: initialAlignment,
            firstItemAlign: FirstItemAlign.end,
          ),
        );
    

    I hope you find an approach to find the problem

    opened by anormal81 20
  • Got incorrect position using renderObject when list is reversed and firstItemAlign is end

    Got incorrect position using renderObject when list is reversed and firstItemAlign is end

    Only occurs when items are not enough to fill the screen It's easy to reproduce

    Scaffold(
          body: FlutterListView(
            reverse: true,//
            delegate: FlutterListViewDelegate(
            (BuildContext context, int index) {
          return Container(
            margin: EdgeInsets.symmetric(horizontal: 20, vertical: 5),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(8),
              color: Color(0xFF333333),
            ),
            height: 100,
            child: Builder(
              builder: (BuildContext context) {
                return GestureDetector(
                  onTap: () {
                    try{
                      var box = context.findRenderObject() as RenderBox;
                      final Offset offset = box.localToGlobal(Offset.zero);
                      var size = box.size;
                      Get.to(Material(
                        color: Colors.transparent,
                        child: Stack(
                          children: [
                            Positioned(
                              left: offset.dx,
                              top: offset.dy,
                              child: Container(
                                color: Colors.yellow,
                                width: size.width,
                                height: size.height,
                              ),
                            )
                          ],
                        ),
                      ));
                    }catch(e){
                      print(e);
                    }
                  },
                );
              },
            ),
          );},
              childCount: 5,
              firstItemAlign: FirstItemAlign.end, //for sure the list is aligning top
            ),
          ),
        );
    
    
    opened by Iridescentangle 6
  • [cacheExtent] is ineffective

    [cacheExtent] is ineffective

    Hi! Thanks for your great work, but i'm stuck in setting cacheExtent.

    Example code:

    class HomePage extends StatelessWidget {
    
      @override
      Widget build(BuildContext context) {
        return FlutterListView(
          cacheExtent: 500,
          delegate: FlutterListViewDelegate(
            (context, index) {
              print(index);
              return Container(color: Colors.red, height: 50);
            },
            childCount: 500,
            onItemKey: (index) => index.toString(),
            onItemHeight: (index) => 50,
          ),
        );
      }
    }
    

    For my device, enter this page will get index outputs 1 to 34. But if i change cacheExtent to another value(no matter what its value is), the outputs is always same(1 to 34). I wonder if there's any mistake in my code?

    opened by jiangtian616 4
  • boundcing scroll offset

    boundcing scroll offset

    预期: 下拉回弹会定位到顶部第一个元素. 但是现在会回弹至第2,3个元素才停止

    expect: bouncing and stop edge first item

    ----screen top edge-----
    ------  <-- expect stop position
    -------
    ------- <-- current version stop scroll offset
    -------
    ------- 
    
    
    class BingoPage extends StatefulWidget {
      @override
      State<BingoPage> createState() => _BingoPageState();
    }
    
    class _BingoPageState extends State<BingoPage> {
      final logic = Get.find<BingoLogic>();
    
      final data = <String>[];
    
      @override
      void initState() {
        // mock chat list insert data
        Timer.periodic(Duration(seconds: 1), (timer) {
          setState(() {
            data.insert(0, DateTime.now().toString());
          });
        });
        super.initState();
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
            body: FlutterListView(
                reverse: true,
                delegate: FlutterListViewDelegate(
                  (BuildContext context, int index) => ListTile(title: Text('List Item ${data[index]}')),
                  childCount: data.length,
                  keepPosition: true,
                )));
      }
    }
    
    
    opened by qyu37 4
  • PopupMenuButton doesn't work

    PopupMenuButton doesn't work

    I'm trying to integrate PopupMenuButton with FlutterListView but it doesn't show menu buttons when I click on more_vertical icon.

    FlutterListView(
                      controller: ctl.listViewController,
                      delegate: FlutterListViewDelegate((context, index) {
                        return ListTile(
                          title: Text('index: $index'),
                          trailing: PopupMenuButton<String>(
                            key: ValueKey(index),
                            offset: const Offset(0, 8),
                            child: const Icon(Icons.more_vert),
                            itemBuilder: (context) {
                              return const [
                                PopupMenuItem(
                                  value: 'edit',
                                  child: Text('Edit'),
                                ),
                                PopupMenuItem(
                                  value: 'delete',
                                  child: Text('Delete'),
                                )
                              ];
                            },
                            onSelected: (val) {
                              Fluttertoast.showToast(msg: val);
                            },
                          ),
                        );
    

    2022-03-24 18 31 13

    After clicking on more_vertical icon It show these errors:

    ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════
    The following assertion was thrown during a scheduler callback:
    Offset argument contained a NaN value.
    'dart:ui/painting.dart':
    Failed assertion: line 43 pos 10: '<optimized out>'
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially
    more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=2_bug.md
    
    When the exception was thrown, this was the stack:
    #2      _offsetIsValid (dart:ui/painting.dart:43:10)
    #3      Path.contains (dart:ui/painting.dart:2557:12)
    #4      PhysicalModelLayer.findAnnotations (package:flutter/src/rendering/layer.dart:2055:20)
    #5      ContainerLayer.findAnnotations (package:flutter/src/rendering/layer.dart:986:37)
    #6      OffsetLayer.findAnnotations (package:flutter/src/rendering/layer.dart:1217:18)
    #7      ContainerLayer.findAnnotations (package:flutter/src/rendering/layer.dart:986:37)
    #8      OffsetLayer.findAnnotations (package:flutter/src/rendering/layer.dart:1217:18)
    #9      ContainerLayer.findAnnotations (package:flutter/src/rendering/layer.dart:986:37)
    #10     OffsetLayer.findAnnotations (package:flutter/src/rendering/layer.dart:1217:18)
    #11     ContainerLayer.findAnnotations (package:flutter/src/rendering/layer.dart:986:37)
    #12     OffsetLayer.findAnnotations (package:flutter/src/rendering/layer.dart:1217:18)
    #13     TransformLayer.findAnnotations (package:flutter/src/rendering/layer.dart:1702:18)
    #14     Layer.find (package:flutter/src/rendering/layer.dart:494:5)
    #15     RenderView._updateSystemChrome (package:flutter/src/rendering/view.dart:287:60)
    #16     RenderView.compositeFrame (package:flutter/src/rendering/view.dart:230:9)
    #17     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:501:18)
    #18     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:883:13)
    #19     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5)
    #20     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
    #21     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081:9)
    #22     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995:5)
    #26     _invoke (dart:ui/hooks.dart:151:10)
    #27     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
    #28     _drawFrame (dart:ui/hooks.dart:115:31)
    (elided 5 frames from class _AssertionError and dart:async)
    

    Doctor summery

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 2.10.4, on macOS 12.2 21D49 darwin-x64, locale en-KH)
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    [✓] Android Studio (version 2021.1)
    [✓] VS Code (version 1.65.2)
    [✓] Connected device (1 available)
    [✓] HTTP Host Availability
    
    • No issues found!
    
    opened by serey168 2
  • Deleted items still wisible by tester

    Deleted items still wisible by tester

    I faced with issue when I remove items from FlutterListView they still visible by tester.

    You can reproduce this problem by runing test in this project https://github.com/krida2000/flutter_list_view_problem.

    This problem fixed by uncoment this code: image

    Can wee just uncoment this code or there is a better solution?

    opened by krida2000 1
  • exception about lastDetails is DragStartDetails is not true

    exception about lastDetails is DragStartDetails is not true

    thanks for your awesome work. when use get some exception:

    
    flutter:   ERROR   ERROR │ ⛔ ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞══════════════════════
    flutter:   ERROR   ERROR │ ⛔ The following assertion was thrown during a scheduler callback:
    flutter:   ERROR   ERROR │ ⛔ 'package:flutter/src/widgets/scroll_activity.dart': Failed
    flutter:   ERROR   ERROR │ ⛔ assertion: line 457 pos 12: 'lastDetails is DragStartDetails': is
    flutter:   ERROR   ERROR │ ⛔ not true.
    
    
    flutter:   ERROR   ERROR │ ⛔ When the exception was thrown, this was the stack:
    flutter:   ERROR   ERROR │ ⛔ #2      DragScrollActivity.dispatchScrollStartNotification (package:flutter/src/widgets/scroll_activity.dart:457:12)
    flutter:   ERROR   ERROR │ ⛔ #3      ScrollPosition.didStartScroll (package:flutter/src/widgets/scroll_position.dart:895:15)
    flutter:   ERROR   ERROR │ ⛔ #4      FlutterListViewElement.notifyPositionChanged.<anonymous closure> (package:flutter_list_view/src/flutter_list_view_element.dart:188:17)
    flutter:   ERROR   ERROR │ ⛔ #5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
    flutter:   ERROR   ERROR │ ⛔ #6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1089:9)
    flutter:   ERROR   ERROR │ ⛔ #7      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995:5)
    flutter:   ERROR   ERROR │ ⛔ #11     _invoke (dart:ui/hooks.dart:151:10)
    flutter:   ERROR   ERROR │ ⛔ #12     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
    flutter:   ERROR   ERROR │ ⛔ #13     _drawFrame (dart:ui/hooks.dart:115:31)
    flutter:   ERROR   ERROR │ ⛔ (elided 5 frames from class _AssertionError and dart:async)
    flutter:   ERROR   ERROR │ ⛔ ═════════════════════════════════════════════════════════════════
    
    opened by qyu37 1
  • Assertion 'child.parent == this': is not true

    Assertion 'child.parent == this': is not true

    尝试在项目中引入flutter_list_view用来展示消息列表,展示正常,但是下拉加载历史消息时(因为消息列表是反转的)抛出异常

    ======== Exception caught by rendering library =====================================================
    The following assertion was thrown during performLayout():
    RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout().
    'package:flutter/src/rendering/box.dart':
    Failed assertion: line 1938 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout ||
                  (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'
    
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=2_bug.md
    
    The relevant error-causing widget was: 
      FlutterSliverList file:///Users/xx/Documents/workspace/xx/flutter_list_view/lib/src/flutter_list_view.dart:161:7
    When the exception was thrown, this was the stack: 
    #2      RenderBox.size.<anonymous closure> (package:flutter/src/rendering/box.dart:1938:13)
    #3      RenderBox.size (package:flutter/src/rendering/box.dart:1951:6)
    #4      FlutterListViewRender.performLayout (package:flutter_list_view/src/flutter_list_view_render.dart:213:30)
    #5      RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
    #6      RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:510:13)
    ...
    The following RenderObject was being processed when the exception was fired: FlutterListViewRender#7574b relayoutBoundary=up1 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
    ...  needs compositing
    ...  parentData: paintOffset=Offset(0.0, 0.0) (can use size)
    ...  constraints: SliverConstraints(AxisDirection.up, GrowthDirection.forward, ScrollDirection.reverse, scrollOffset: 825.5, remainingPaintExtent: 718.0, crossAxisExtent: 432.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 718.0, remainingCacheExtent: 1218.0, cacheOrigin: -250.0)
    ...  geometry: SliverGeometry(scrollExtent: 1922.1, paintExtent: 718.0, maxPaintExtent: 718.0, hasVisualOverflow: true, cacheExtent: 1218.0)
    ...    scrollExtent: 1922.1
    ...    paintExtent: 718.0
    ...    maxPaintExtent: 718.0
    ...    hasVisualOverflow: true
    ...    cacheExtent: 1218.0
    RenderObject: FlutterListViewRender#7574b relayoutBoundary=up1 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
      needs compositing
      parentData: paintOffset=Offset(0.0, 0.0) (can use size)
      constraints: SliverConstraints(AxisDirection.up, GrowthDirection.forward, ScrollDirection.reverse, scrollOffset: 825.5, remainingPaintExtent: 718.0, crossAxisExtent: 432.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 718.0, remainingCacheExtent: 1218.0, cacheOrigin: -250.0)
      geometry: SliverGeometry(scrollExtent: 1922.1, paintExtent: 718.0, maxPaintExtent: 718.0, hasVisualOverflow: true, cacheExtent: 1218.0)
        scrollExtent: 1922.1
        paintExtent: 718.0
        maxPaintExtent: 718.0
        hasVisualOverflow: true
        cacheExtent: 1218.0
    ====================================================================================================
    
    
    ======== Exception caught by rendering library =====================================================
    The following assertion was thrown during paint():
    'package:flutter_list_view/src/flutter_list_view_render.dart': Failed assertion: line 844 pos 12: 'child.parent == this': is not true.
    
    The relevant error-causing widget was: 
      FlutterSliverList file:///Users/xx/Documents/workspace/xx/flutter_list_view/lib/src/flutter_list_view.dart:161:7
    When the exception was thrown, this was the stack: 
    #2      FlutterListViewRender.childScrollOffset (package:flutter_list_view/src/flutter_list_view_render.dart:844:12)
    #3      FlutterListViewRender.childMainAxisPosition (package:flutter_list_view/src/flutter_list_view_render.dart:838:14)
    #4      FlutterListViewRender.paint (package:flutter_list_view/src/flutter_list_view_render.dart:680:36)
    #5      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2317:7)
    #6      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
    ...
    The following RenderObject was being processed when the exception was fired: FlutterListViewRender#7574b relayoutBoundary=up1
    ...  needs compositing
    ...  parentData: paintOffset=Offset(0.0, 0.0) (can use size)
    ...  constraints: SliverConstraints(AxisDirection.up, GrowthDirection.forward, ScrollDirection.reverse, scrollOffset: 825.5, remainingPaintExtent: 718.0, crossAxisExtent: 432.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 718.0, remainingCacheExtent: 1218.0, cacheOrigin: -250.0)
    ...  geometry: SliverGeometry(scrollExtent: 1922.1, paintExtent: 718.0, maxPaintExtent: 718.0, hasVisualOverflow: true, cacheExtent: 1218.0)
    ...    scrollExtent: 1922.1
    ...    paintExtent: 718.0
    ...    maxPaintExtent: 718.0
    ...    hasVisualOverflow: true
    ...    cacheExtent: 1218.0
    RenderObject: FlutterListViewRender#7574b relayoutBoundary=up1
      needs compositing
      parentData: paintOffset=Offset(0.0, 0.0) (can use size)
      constraints: SliverConstraints(AxisDirection.up, GrowthDirection.forward, ScrollDirection.reverse, scrollOffset: 825.5, remainingPaintExtent: 718.0, crossAxisExtent: 432.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 718.0, remainingCacheExtent: 1218.0, cacheOrigin: -250.0)
      geometry: SliverGeometry(scrollExtent: 1922.1, paintExtent: 718.0, maxPaintExtent: 718.0, hasVisualOverflow: true, cacheExtent: 1218.0)
        scrollExtent: 1922.1
        paintExtent: 718.0
        maxPaintExtent: 718.0
        hasVisualOverflow: true
        cacheExtent: 1218.0
    ====================================================================================================
    
    opened by Iridescentangle 0
  • Uncorrect `animateToIndex` animation

    Uncorrect `animateToIndex` animation

    If call animateToIndex to element in end of the list, then animation will be uncorrect.

    Problem

    https://user-images.githubusercontent.com/71345244/209559725-76ba3cbf-fff7-4798-9b6d-50dfbae38655.mp4

    I have fixed it by folowing changes:

    Fix

    image

    opened by krida2000 3
  • ensureVisible issue,the offset need to increase scrollOffset

    ensureVisible issue,the offset need to increase scrollOffset

    @@ -205,10 +205,11 @@ class FlutterListViewElement extends RenderObjectElement {
        // paintedElements
        var flutterListViewRender = renderObject as FlutterListViewRender;
        var viewportHeight = flutterListViewRender.currentViewportHeight ?? 0;
    +   var scrollOffset = flutterListViewRender.currentScrollOffset ?? 0.0;
        for (var item in flutterListViewRender.paintedElements) {
          if (item.index == index &&
              item.offset > 0 &&
    -          item.offset + item.height < viewportHeight) {
    +          item.offset + item.height <= viewportHeight + scrollOffset) {
            return;
          }
        }
    
    
    opened by huage2580 1
  •  我有一个问题listview在快速滚动时异常 I have a problem that the listview is abnormal when scrolling quickly

    我有一个问题listview在快速滚动时异常 I have a problem that the listview is abnormal when scrolling quickly

    er: │ 'package:flutter/src/widgets/framework.dart': Failed assertion: line 2535 pos 20: '_debugCurrentBuildTarget == context': is not true. flutter: │ flutter: │ #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:47:61) flutter: │ #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5) flutter: │ #2 BuildOwner.buildScope. (package:flutter/src/widgets/framework.dart:2535:20) flutter: │ #3 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2539:12) flutter: │ #4 FlutterListViewElement.updateChild (package:flutter_list_view/src/flutter_list_view_element.dart:605:12) flutter: │ #5 FlutterListViewElement._createOrReuseElement (package:flutter_list_view/src/flutter_list_view_element.dart:525:7) flutter: │ #6 FlutterListViewElement.constructNextElement (package:flutter_list_view/src/flutter_list_view_element.dart:566:18) flutter: │ #7 FlutterListViewRender.performLayout. (package:flutter_list_view/src/flutter_list_view_render.dart:206:34) flutter: │ #8 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1962:59) flutter: │ #9 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:910:15) flutter: │ #10 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1962:14) flutter: │ #11 FlutterListViewRender.performLayout (package:flutter_list_view/src/flutter_list_view_render.dart:205:7) flutter: │ #12 RenderObject.layout (package:flutter/src/rendering/object.dart:1852:7) flutter: │ #13 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:510:13) flutter: │ #14 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1580:12) flutter: │ #15 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1489:20) flutter: │ #16 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1707:7) flutter: │ #17 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:879:18) flutter: │ #18 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:497:19) flutter: │ #19 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:883:13) flutter: │ #20 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5) flutter: │ #21 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1145:15) flutter: │ #22 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9) flutter: │ #23 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996:5) flutter: │ #24 _rootRun (dart:async/zone.dart:1428:13) flutter: │ #25 _CustomZone.run (dart:async/zone.dart:1328:19) flutter: │ #26 _CustomZone.runGuarded (dart:async/zone.dart:1236:7) flutter: │ #27 _invoke (dart:ui/hooks.dart:150:10) flutter: │ #28 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5) flutter: │ #29 _drawFrame (dart:ui/hooks.dart:114:31)

    opened by fengyuyxz 0
  • I have a problem with chat view, help please

    I have a problem with chat view, help please

    first, very thanks for this project, I try to implement chat view, and load message from the top down, but I failure, some problems always occur with me. I use your project and implement chat functional basically. but when I create a new chat view, and send message one by one, the chat view always has a brief flicker and the animation is not very smooth, I don't known how to config can avoid this problem, help me please. GIF 2022-8-19 17-04-41

    opened by endison1986 8
  • Touch position are incorrect

    Touch position are incorrect

    Hi, The touch position of the item is incorrect,when items not out of page.

    edit in your chat example :

    import 'dart:math';
    import 'dart:ui';
    
    import 'package:flutter/cupertino.dart';
    import 'package:flutter_list_view/flutter_list_view.dart';
    import 'package:flutter/material.dart';
    import 'package:pull_to_refresh/pull_to_refresh.dart';
    
    enum MessageType {
      sent,
      receive,
      tag,
    }
    
    class ChatModel {
      ChatModel({required this.id, required this.msg, required this.type});
    
      int id;
      String msg;
      MessageType type;
    }
    
    class Chat extends StatefulWidget {
      const Chat({Key? key}) : super(key: key);
    
      @override
      _ChatState createState() => _ChatState();
    }
    
    class _ChatState extends State<Chat> {
      int currentId = 0;
      List<ChatModel> messages = [];
      final myController = TextEditingController();
      final listViewController = FlutterListViewController();
      final refreshController = RefreshController(initialRefresh: false);
    
      /// Using init index to control load first messages
      int initIndex = 0;
      double initOffset = 0.0;
      bool initOffsetBasedOnBottom = true;
      int forceToExecuteInitIndex = 0;
    
      // Fire refresh temp variable
      double prevScrollOffset = 0;
    
      List<FlutterListViewItemPosition>? itemPositions;
      double listviewHeight = 0;
    
      @override
      void initState() {
        _loadMessages();
        listViewController.addListener(() {
          const torrentDistance = 40;
          var offset = listViewController.offset;
          if (offset <= torrentDistance && prevScrollOffset > torrentDistance) {
            if (!refreshController.isRefresh) {
              refreshController.requestRefresh();
            }
          }
    
          prevScrollOffset = offset;
        });
    
        listViewController.sliverController.onPaintItemPositionsCallback = (widgetHeight, positions) {
          itemPositions = positions;
          listviewHeight = widgetHeight;
        };
    
        super.initState();
      }
    
      /// It is mockup to load messages from server
      _loadMessages() async {
        await Future.delayed(const Duration(milliseconds: 100));
        var prevTimes = Random().nextInt(20) + 1;
        // for (var i = 0; i < prevTimes; i++) {
        //   _insertReceiveMessage("The demo also show how to reverse a list in\r\n" *
        //       (Random().nextInt(4) + 1));
        // }
        _insertTagMessage("Last readed");
        var nextTimes = Random().nextInt(20) + 1;
        // for (var i = 0; i < nextTimes; i++) {
        //   _insertReceiveMessage("The demo also show how to reverse a list in\r\n" *
        //       (Random().nextInt(4) + 1));
        // }
        _insertSendMessage("If message more than two screens and scroll over 80px, the scroll not move if a message coming or you input a message");
        _insertSendMessage("It resoved the problem which is when you read a message while a lot of messages coming");
        _insertSendMessage("You can't focus the message content what you read");
        _insertSendMessage("The demo also show how to reverse a list in the controll");
        _insertSendMessage("When reverse the list, the item still show on top of list if the messages didn't fill full screen");
    
        initIndex = messages.length - prevTimes - 1;
        print("--------------------$initIndex");
    
        setState(() {});
      }
    
      _insertSendMessage(String msg, {bool appendToTailer = false}) {
        if (appendToTailer) {
          messages.add(ChatModel(id: ++currentId, msg: msg.trim(), type: MessageType.sent));
        } else {
          messages.insert(0, ChatModel(id: ++currentId, msg: msg.trim(), type: MessageType.sent));
        }
      }
    
      _insertReceiveMessage(String msg, {bool appendToTailer = false}) {
        if (appendToTailer) {
          messages.add(ChatModel(id: ++currentId, msg: msg.trim(), type: MessageType.receive));
        } else {
          messages.insert(0, ChatModel(id: ++currentId, msg: msg.trim(), type: MessageType.receive));
        }
      }
    
      _insertTagMessage(String msg) {
        messages.insert(0, ChatModel(id: ++currentId, msg: msg.trim(), type: MessageType.tag));
      }
    
      _mockToReceiveMessage() {
        var times = Random().nextInt(4) + 1;
        for (var i = 0; i < times; i++) {
          _insertReceiveMessage("The demo also show how to reverse a list in\r\n" * (Random().nextInt(4) + 1));
        }
        setState(() {});
      }
    
      _sendMessage() {
        if (myController.text.isNotEmpty) {
          if (messages.isNotEmpty) {
            listViewController.sliverController.jumpToIndex(0);
          }
          setState(() {
            _insertSendMessage(myController.text);
          });
    
          myController.text = "";
        }
      }
    
      void _onRefresh() async {
        print("------------------------------------_onRefresh");
        await Future.delayed(const Duration(milliseconds: 2000));
    
        var newMessgeLength = 20;
    
        for (var i = 0; i < newMessgeLength; i++) {
          _insertReceiveMessage("The demo also show how to reverse a list in\r\n" * (Random().nextInt(4) + 1));
        }
    
        var firstIndex = newMessgeLength;
        var firstOffset = 0.0;
        if (itemPositions != null && itemPositions!.isNotEmpty) {
          var firstItemPosition = itemPositions![0];
          firstIndex = firstItemPosition.index + newMessgeLength;
          firstOffset = listviewHeight - firstItemPosition.offset - firstItemPosition.height;
        }
    
        initIndex = firstIndex;
        initOffsetBasedOnBottom = false;
        forceToExecuteInitIndex++;
        initOffset = firstOffset;
        refreshController.refreshCompleted();
        setState(() {});
      }
    
      void _onLoading() async {
        await Future.delayed(const Duration(milliseconds: 1000));
    
        for (var i = 0; i < 50; i++) {
          _insertReceiveMessage("The demo also show how to append message\r\n" * (Random().nextInt(4) + 1), appendToTailer: true);
        }
    
        if (mounted) setState(() {});
        refreshController.loadComplete();
      }
    
      _renderItem(int index) {
        var msg = messages[index];
        if (msg.type == MessageType.tag) {
          return Align(
            alignment: Alignment.center,
            child: Padding(
              padding: const EdgeInsets.all(10.0),
              child: Container(
                decoration: const BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.all(Radius.circular(5))),
                child: Padding(
                  padding: const EdgeInsets.all(10.0),
                  child: Text(
                    msg.msg,
                    style: const TextStyle(fontSize: 14.0, color: Colors.white),
                  ),
                ),
              ),
            ),
          );
        } else {
          return Align(
            alignment: msg.type == MessageType.sent ? Alignment.centerRight : Alignment.centerLeft,
            child: Padding(
              padding: const EdgeInsets.all(10.0),
              child: GestureDetector(
                onTap: () {
                  print(msg.msg);
                },
                child: Container(
                  decoration: BoxDecoration(
                      color: msg.type == MessageType.sent ? Colors.blue : Colors.green,
                      borderRadius: msg.type == MessageType.sent
                          ? const BorderRadius.only(topLeft: Radius.circular(20), bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20))
                          : const BorderRadius.only(topRight: Radius.circular(20), bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20))),
                  child: Padding(
                    padding: const EdgeInsets.all(10.0),
                    child: Text(
                      msg.msg,
                      style: const TextStyle(fontSize: 14.0, color: Colors.white),
                    ),
                  ),
                ),
              ),
            ),
          );
        }
      }
    
      _renderList() {
        return ScrollConfiguration(
          behavior: ScrollConfiguration.of(context).copyWith(dragDevices: {
            PointerDeviceKind.touch,
            PointerDeviceKind.mouse,
          }),
          child: SmartRefresher(
              enablePullDown: false,
              enablePullUp: false,
              header: CustomHeader(
                completeDuration: const Duration(milliseconds: 0),
                builder: (context, mode) {
                  Widget body;
                  if (mode == RefreshStatus.idle) {
                    body = const Text("Pull up load prev msg");
                  } else if (mode == RefreshStatus.refreshing) {
                    body = const CupertinoActivityIndicator();
                  } else if (mode == RefreshStatus.failed) {
                    body = const Text("Load Failed!Click retry!");
                  } else if (mode == RefreshStatus.canRefresh) {
                    body = const Text("Release to load more");
                  } else {
                    body = const Text("No more Data");
                  }
                  if (mode == RefreshStatus.completed) {
                    return Container();
                  } else {
                    return RotatedBox(
                      quarterTurns: 2,
                      child: SizedBox(
                        height: 55.0,
                        child: Center(child: body),
                      ),
                    );
                  }
                },
              ),
              // const WaterDropHeader(),
              footer: CustomFooter(
                builder: (context, mode) {
                  Widget body;
                  if (mode == LoadStatus.idle) {
                    body = const Text("Pull down to load more message");
                  } else if (mode == LoadStatus.loading) {
                    body = const CupertinoActivityIndicator();
                  } else if (mode == LoadStatus.failed) {
                    body = const Text("Load Failed!Click retry!");
                  } else if (mode == LoadStatus.canLoading) {
                    body = const Text("Release to load more");
                  } else {
                    body = const Text("No more Data");
                  }
                  return SizedBox(
                    height: 55.0,
                    child: Center(child: body),
                  );
                },
              ),
              controller: refreshController,
              onRefresh: _onRefresh,
              onLoading: _onLoading,
              child: FlutterListView(
                  reverse: true,
                  controller: listViewController,
                  delegate: FlutterListViewDelegate((BuildContext context, int index) => _renderItem(index),
                      childCount: messages.length,
                      onItemKey: (index) => messages[index].id.toString(),
                      keepPosition: true,
                      keepPositionOffset: 40,
                      initIndex: initIndex,
                      initOffset: initOffset,
                      initOffsetBasedOnBottom: initOffsetBasedOnBottom,
                      forceToExecuteInitIndex: forceToExecuteInitIndex,
                      firstItemAlign: FirstItemAlign.end))),
        );
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(
              title: const Text("Chat"),
              actions: [
                TextButton(
                    onPressed: _mockToReceiveMessage,
                    child: const Text(
                      "Mock To Receive",
                      style: TextStyle(color: Colors.white),
                    ))
              ],
            ),
            resizeToAvoidBottomInset: true,
            body: GestureDetector(
                onTap: () {
                  FocusScopeNode currentFocus = FocusScope.of(context);
                  if (!currentFocus.hasPrimaryFocus) {
                    currentFocus.unfocus();
                  }
                },
                behavior: HitTestBehavior.opaque,
                child: SafeArea(
                  child: Padding(
                    padding: const EdgeInsets.only(bottom: 8.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.stretch,
                      mainAxisSize: MainAxisSize.min,
                      children: [
                        Expanded(flex: 1, child: _renderList()),
                        Padding(
                          padding: const EdgeInsets.symmetric(horizontal: 20.0),
                          child: Row(children: [
                            Expanded(
                              child: TextField(
                                controller: myController,
                              ),
                            ),
                            ElevatedButton(onPressed: _sendMessage, child: const Text("Send"))
                          ]),
                        )
                      ],
                    ),
                  ),
                )));
      }
    
      @override
      void dispose() {
        myController.dispose();
        listViewController.dispose();
        refreshController.dispose();
        super.dispose();
      }
    }
    
    opened by HuangZiquan 2
  • Activate the keyboard, then manually scroll down the list to the bottom, and then lose the keyboard, as if it would appear

    Activate the keyboard, then manually scroll down the list to the bottom, and then lose the keyboard, as if it would appear

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderIndexedSemantics does not meet its constraints. The relevant error-causing widget was FlutterSliverList ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ Invalid argument(s): 0.0 The relevant error-causing widget was SmartRefresher ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ BoxConstraints has non-normalized width constraints. The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ BoxConstraints has non-normalized width constraints. The relevant error-causing widget was Container ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ BoxConstraints has both width and height constraints non-normalized. The relevant error-causing widget was Column ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ BoxConstraints has both width and height constraints non-normalized. The relevant error-causing widget was GestureDetector ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ BoxConstraints has both width and height constraints non-normalized. The relevant error-causing widget was GestureDetector ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by scheduler library ═════════════════════════════════ 'package:flutter/src/semantics/semantics.dart': Failed assertion: line 3995 pos 12: 'value != null && value >= 0.0': is not true. ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by scheduler library ═════════════════════════════════ 'package:flutter/src/animation/animation_controller.dart': Failed assertion: line 822 pos 12: 'elapsedInSeconds >= 0.0': is not true. ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════ flutter: (at_bottom_tab.dart line:159): bottomTab dispose 840232081

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#205b3 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/rendering/object.dart': Failed assertion: line 1601 pos 12: '_debugCanPerformMutations': is not true. ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#bb69f parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#6ff6b parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#ec916 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#6bdd9 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#027b9 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#34c80 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#dcd0f parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#5401c parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#0947a parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#6d344 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#9bbb1 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#2c4d7 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by widgets library ═══════════════════════════════════ 'package:flutter/src/material/button_theme.dart': Failed assertion: line 219 pos 15: 'minWidth != null && minWidth >= 0.0': is not true. The relevant error-causing widget was MaterialApp ════════════════════════════════════════════════════════════════════════════════

    ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox.size accessed beyond the scope of resize, layout, or permitted parent access. RenderBox can always access its own size, otherwise, the only object that is allowed to read RenderBox.size is its parent, if they have said they will. It you hit this assert trying to access a child's size, pass "parentUsesSize: true" to that child's layout(). 'package:flutter/src/rendering/box.dart': Failed assertion: line 1935 pos 13: 'debugDoingThisResize || debugDoingThisLayout || _computingThisDryLayout || (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)'

    The relevant error-causing widget was MaterialApp The following RenderObject was being processed when the exception was fired: RenderCustomPaint#5e339 RenderObject: RenderCustomPaint#5e339 parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) child: RenderErrorBox#3ff2b parentData: (can use size) constraints: BoxConstraints(w=428.0, h=926.0) size: Size(428.0, 926.0) ════════════════════════════════════════════════════════════════════════════════

    opened by fujiekai 4
Releases(V1.1.20)
Owner
null
Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map.

Custom Radio Group List Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map. Feature

Ashok Kumar Verma 0 Nov 30, 2021
VerificaC19-flutter - Unofficial EU DGC validation package for Flutter

VerificaC19 package for Flutter About This package allows to decode and validate

Federico Mastrini 13 Oct 21, 2022
The unofficial flutter plugin for Freshchat

?? Flutter Freshchat A Flutter plugin for integrating Freshchat in your mobile app. Setup Android Add this to your AndroidManifest.xml <provider a

Fayeed Pawaskar 31 Jun 2, 2022
Unofficial delivery app for Rapidinho made with Flutter

Rapidinho Unofficial delivery app for Rapidinho made with Flutter Getting Started Gradle version: 4.6 Flutter version: 0.8.3 Install Flutter Clone thi

GDG Luanda 190 Dec 26, 2022
Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter

Turkish Dictionary Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter Design Feyza Nur Demirci Şahin Abut

Flutter Turkey 80 Oct 20, 2022
Flutter & Dart Unofficial Flat Data API

Flutter & Dart Unofficial Flat Data API Flat Dataset for different helpful Flutter APIs Flutter Releases Currently does a daily snapshot of the Flutte

Leo Farias 21 Dec 26, 2022
An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS

Pusher Flutter Client An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS. Get it from pub. How

HomeX 31 Oct 21, 2022
Vrchat mobile client - VRChat Unofficial Mobile Client For Flutter

VRChatMC VRChatの非公式なAPIを利用したVRChatのモバイルクライアント Flutterで作成されたシンプルなUIが特徴的です iosビルドは

ふぁ 8 Sep 28, 2022
An unofficial wrapper for the kdecole api

This is an UNOFFICIAL wrapper for the kdecole api How to use ? Login First, you need to create a Client() object : LOGIN AND PASSWORD ARE NOT YOUR ENT

null 5 Nov 2, 2022
unofficial windows client for smotreshka.tv

smotreshka Rebuild models flutter pub run build_runner build --delete-conflicting-outputs Getting Started This project is a starting point for a Flut

null 0 Dec 3, 2021
Unofficial 🐘 client written in 🎯

mastodon_dart The official Dart library for accessing the Mastodon API. Optionally use in conjunction with mastodon_flutter to build a Flutter Mastodo

Luke Pighetti 21 Dec 22, 2022
Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.

An unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart. This package is using logging package to do the actual logging,

Kirill Bubochkin 2 Mar 3, 2021
An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

DioHub for Github Summary Features Roadmap Support Screenshots Build Instructions Summary DioHub is an open-source unofficial GitHub mobile client, th

Naman Shergill 401 Jan 4, 2023
Unofficial KronoX app for Android and iOS

School Schedule Unofficial KronoX app for Android and iOS made using Flutter Supported Platforms The app is available on Google Play. It's not availab

kraxie 8 Oct 31, 2022
Flathub-desktop - Unofficial Desktop Client for Flathub

Flathub Desktop Unofficial Desktop Client for Flathub How to build and run: You

Jean3219 2 Sep 19, 2022
Federico 1 Feb 3, 2022
An unofficial nhentai app.

Eros-N English | 简体中文 Introduction An unofficial Nhentai app. Features Front page User login Favorites View gallery Gallery tags More view settings Do

null 131 Jan 9, 2023
An unofficial, platform independent, client for accessing different AI models developed by OpenAI

The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code. They offer a spectrum of model

Francesco Coppola 14 Dec 30, 2022
Grid-View-App - Grid View App For Flutter

grid_view_app practice purpose flutter application Getting Started This project

Md Tarequl Islam 4 Jun 9, 2022