-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Column contains GridView #69370
Comments
@Jiangshan2015 code sampleimport 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp() : super(key: const Key('MyApp'));
@override
Widget build(BuildContext context) => const MaterialApp(
home: MyHomePage(),
);
}
class MyHomePage extends StatelessWidget {
const MyHomePage() : super(key: const Key('MyHomePage'));
static const _rgb = [Colors.red, Colors.green, Colors.blue];
List<List<int>> get _listOfList => [
[for (int i = 0; i < 10; i++) i],
[for (int i = 10; i < 20; i++) i],
[for (int i = 20; i < 30; i++) i],
];
@override
Widget build(BuildContext context) {
final listOfList = _listOfList;
return Material(
child: SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: ListView.builder(
itemCount: listOfList.length,
itemBuilder: (context, index) =>
/// [wrapping in Column to repro the initial code,]
/// [but doesn't seem to make much sense]
Column(
children: <Widget>[
Container(
color: _rgb[index % _rgb.length],
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: GridView.count(
crossAxisCount: 5,
children: <Widget>[
for (int i in listOfList[index])
Center(
child: Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: Text('$i'),
),
),
),
],
),
),
],
),
),
),
);
}
}
the issue you are experiencing is not caused by Flutter, but it's likely from your implementation |
@Jiangshan2015 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
@override Widget build(BuildContext context) { print(">>>${this.myComicList[1].titleIconUrl}"); return Container( height: 300, child: ListView.builder( shrinkWrap: true, padding: EdgeInsets.all(0), itemCount: this.myComicList.length, itemBuilder: (BuildContext context, int index) { return Column( children: [ GridView.count( crossAxisSpacing: 10.0, mainAxisSpacing: 30.0, padding: EdgeInsets.all(10.0), crossAxisCount: 2, childAspectRatio: 2.0, children: getWidgetList(), ) ], ); }, ),
As a beginner, I really don't understand this error
flutter: When the exception was thrown, this was the stack:
flutter: #0 List.[] (dart:core-patch/growable_array.dart:177:60)
flutter: #1 HomeCollectionView.build (package:cartoon_flutter/pages/homePage/view/HomeCollectionView.dart:34:33)
flutter: #2 StatelessElement.build (package:flutter/src/widgets/framework.dart:4701:28)
flutter: #3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4627:15)
flutter: #4 Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
flutter: #5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
flutter: #6 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
flutter: #7 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
flutter: #8 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6236:32)
flutter: ... Normal element mounting (59 frames)
flutter: #67 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
flutter: #68 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
flutter: #69 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1158:36)
flutter: #70 SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:1143:20)
flutter: #71 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2683:19)
flutter: #72 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1136:11)
flutter: #73 RenderSliverMultiBoxAdaptor._createOrObtainChild. (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:350:23)
flutter: #74 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1883:59)
flutter: #75 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:915:15)
flutter: #76 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1883:14)
flutter: #77 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:339:5)
flutter: #78 RenderSliverMultiBoxAdaptor.addInitialChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:423:5)
flutter: #79 RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:197:12)
flutter: #80 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #81 RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:132:12)
flutter: #82 _RenderSliverFractionalPadding.performLayout (package:flutter/src/widgets/sliver_fill.dart:170:11)
flutter: #83 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #84 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:507:13)
flutter: #85 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1561:12)
flutter: #86 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1470:20)
flutter: #87 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #88 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #89 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #90 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #91 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #92 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #93 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #94 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #95 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #96 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #97 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #98 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #99 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #100 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:12)
flutter: #101 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:498:7)
flutter: #102 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:243:7)
flutter: #103 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:402:14)
flutter: #104 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #105 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #106 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #107 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #108 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1308:11)
flutter: #109 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #110 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:12)
flutter: #111 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:498:7)
flutter: #112 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:243:7)
flutter: #113 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:402:14)
flutter: #114 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #115 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #116 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #117 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #118 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1308:11)
flutter: #119 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #120 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #121 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #122 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #123 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #124 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #125 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #126 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:560:15)
flutter: #127 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #128 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #129 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #130 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #131 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #132 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #133 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #134 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #135 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #136 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #137 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #138 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #139 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3222:13)
flutter: #140 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #141 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #142 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #143 _RenderTheatre.performLayout (package:flutter/src/widgets/overlay.dart:685:15)
flutter: #144 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #145 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #146 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #147 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #148 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #149 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #150 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #151 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #152 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #153 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:14)
flutter: #154 RenderObject.layout (package:flutter/src/rendering/object.dart:1777:7)
flutter: #155 RenderView.performLayout (package:flutter/src/rendering/view.dart:167:14)
flutter: #156 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1634:7)
flutter: #157 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:884:18)
flutter: #158 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:436:19)
flutter: #159 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:914:13)
flutter: #160 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:302:5)
flutter: #161 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
flutter: #162 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1055:9)
flutter: #163 SchedulerBinding.scheduleWarmUpFrame. (package:flutter/src/scheduler/binding.dart:864:7)
flutter: (elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
flutter:
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: A RenderFlex overflowed by 99647 pixels on the bottom.
The text was updated successfully, but these errors were encountered: