Skip to content

Instantly share code, notes, and snippets.

@vsajip
Created March 19, 2025 20:31
Show Gist options
  • Save vsajip/0108fbbb443feb1d728bf4a1cdd0424c to your computer and use it in GitHub Desktop.
Save vsajip/0108fbbb443feb1d728bf4a1cdd0424c to your computer and use it in GitHub Desktop.
Layout problem in Flutter
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
RenderCustomMultiChildLayoutBox object was given an infinite size
during layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the
RenderCustomMultiChildLayoutBox were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
RenderCustomMultiChildLayoutBox#7601e relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
This RenderObject had the following descendants (showing up to depth 5):
child 1: RenderFlex#86788 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#9c42c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#c841c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#258d7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderConstrainedBox#fca1f NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#ccf17 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 3: RenderParagraph#a7bcd NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 4: RenderSemanticsAnnotations#5554d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#416ac NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderConstrainedBox#95560 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#58329 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#2194c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#1f9c4 NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
_RenderInkFeatures object was given an infinite size during
layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the _RenderInkFeatures were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
_RenderInkFeatures#1aaa5 relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
This RenderObject had the following descendants (showing up to depth 5):
child: RenderCustomMultiChildLayoutBox#7601e relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#86788 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#9c42c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#c841c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#258d7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#ccf17 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 3: RenderParagraph#a7bcd NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 4: RenderSemanticsAnnotations#5554d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#416ac NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#58329 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#2194c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#1f9c4 NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
RenderPhysicalModel object was given an infinite size during
layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the RenderPhysicalModel were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
RenderPhysicalModel#ba683 relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use
size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
elevation: 0.0
color: Color(alpha: 1.0000, red: 0.9961, green: 0.9686, blue:
1.0000, colorSpace: ColorSpace.sRGB)
shadowColor: Color(alpha: 1.0000, red: 0.9961, green: 0.9686,
blue: 1.0000, colorSpace: ColorSpace.sRGB)
shape: BoxShape.rectangle
borderRadius: BorderRadius.zero
This RenderObject had the following descendants (showing up to depth 5):
child: _RenderInkFeatures#1aaa5 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderCustomMultiChildLayoutBox#7601e relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#86788 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#9c42c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#c841c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#ccf17 NEEDS-LAYOUT NEEDS-PAINT
child 3: RenderParagraph#a7bcd NEEDS-LAYOUT NEEDS-PAINT
child 4: RenderSemanticsAnnotations#5554d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#58329 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#2194c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#1f9c4 NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
RenderCustomMultiChildLayoutBox object was given an infinite size
during layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the
RenderCustomMultiChildLayoutBox were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
RenderCustomMultiChildLayoutBox#b64af relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
This RenderObject had the following descendants (showing up to depth 5):
child 1: RenderFlex#64cba NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#528b0 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#93ac7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#62b7e NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderConstrainedBox#6b400 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#73e98 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 3: RenderParagraph#620a3 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 4: RenderSemanticsAnnotations#11e2c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#5c0c1 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderConstrainedBox#a1c63 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#5adf4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#a2ded NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#c289f NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
_RenderInkFeatures object was given an infinite size during
layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the _RenderInkFeatures were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
_RenderInkFeatures#64c00 relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: <none> (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
This RenderObject had the following descendants (showing up to depth 5):
child: RenderCustomMultiChildLayoutBox#b64af relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#64cba NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#528b0 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#93ac7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#62b7e NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#73e98 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 3: RenderParagraph#620a3 NEEDS-LAYOUT NEEDS-PAINT
text: TextSpan
child 4: RenderSemanticsAnnotations#11e2c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: _RenderInputPadding#5c0c1 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#5adf4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#a2ded NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#c289f NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
RenderPhysicalModel object was given an infinite size during
layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the RenderPhysicalModel were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
RenderPhysicalModel#0ec36 relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use
size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
size: Size(749.0, Infinity)
elevation: 0.0
color: Color(alpha: 1.0000, red: 0.9961, green: 0.9686, blue:
1.0000, colorSpace: ColorSpace.sRGB)
shadowColor: Color(alpha: 1.0000, red: 0.9961, green: 0.9686,
blue: 1.0000, colorSpace: ColorSpace.sRGB)
shape: BoxShape.rectangle
borderRadius: BorderRadius.zero
This RenderObject had the following descendants (showing up to depth 5):
child: _RenderInkFeatures#64c00 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderCustomMultiChildLayoutBox#b64af relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#64cba NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderFlex#528b0 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderSemanticsAnnotations#93ac7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderParagraph#73e98 NEEDS-LAYOUT NEEDS-PAINT
child 3: RenderParagraph#620a3 NEEDS-LAYOUT NEEDS-PAINT
child 4: RenderSemanticsAnnotations#11e2c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 2: RenderStack#5adf4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child 1: RenderTransform#a2ded NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
child: RenderTransform#c289f NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by Infinity pixels on the bottom.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in
the rendering with a yellow and black striped pattern. This is
usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget)
to force the children of the RenderFlex to fit within the
available space instead of being sized to their natural size.
This is considered an error condition because it indicates that
there is content that cannot be seen. If the content is
legitimately bigger than the available space, consider clipping
it with a ClipRect widget before putting it in the flex, or using
a scrollable container rather than a Flex, like a ListView.
The specific RenderFlex in question is: RenderFlex#0fb98 relayoutBoundary=up2 OVERFLOWING:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=614.0)
size: Size(749.0, 614.0)
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
═════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞══════════════════════
The following assertion was thrown during performLayout():
RenderPhysicalModel object was given an infinite size during
layout.
This probably means that it is a render object that tries to be
as big as possible, but it was put inside another render object
that allows its children to pick their own size.
The nearest ancestor providing an unbounded height constraint is: RenderFlex#0fb98 relayoutBoundary=up2 OVERFLOWING:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=403.0)
size: Size(749.0, 614.0)
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
The constraints that applied to the RenderPhysicalModel were:
BoxConstraints(0.0<=w<=749.0, 0.0<=h<=Infinity)
The exact size it was given was:
Size(749.0, Infinity)
See https://flutter.dev/to/unbounded-constraints for more
information.
Widget creation tracking is currently disabled. Enabling it
enables improved error messages. It can be enabled by passing
`--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack
The following RenderObject was being processed when the exception was fired:
RenderFlex#0fb98 relayoutBoundary=up2 OVERFLOWING:
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=749.0, 0.0<=h<=403.0)
size: Size(749.0, 614.0)
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
spacing: 0.0
This RenderObject had the following descendants (showing up to depth 5):
child 1: RenderPhysicalModel#ba683 relayoutBoundary=up3
child: _RenderInkFeatures#1aaa5 relayoutBoundary=up4
child: RenderCustomMultiChildLayoutBox#7601e relayoutBoundary=up5
child 1: RenderFlex#86788 NEEDS-LAYOUT NEEDS-PAINT
child 1: RenderFlex#9c42c NEEDS-LAYOUT NEEDS-PAINT
child 2: RenderStack#58329 NEEDS-LAYOUT NEEDS-PAINT
child 1: RenderTransform#2194c NEEDS-LAYOUT NEEDS-PAINT
child 2: RenderPhysicalModel#0ec36 relayoutBoundary=up3
child: _RenderInkFeatures#64c00 relayoutBoundary=up4
child: RenderCustomMultiChildLayoutBox#b64af relayoutBoundary=up5
child 1: RenderFlex#64cba NEEDS-LAYOUT NEEDS-PAINT
child 1: RenderFlex#528b0 NEEDS-LAYOUT NEEDS-PAINT
child 2: RenderStack#5adf4 NEEDS-LAYOUT NEEDS-PAINT
child 1: RenderTransform#a2ded NEEDS-LAYOUT NEEDS-PAINT
═════════════════════════════════════════════════════════════════
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class _CounterWidgetState extends State<CounterWidget> {
_CounterWidgetState(this._label);
final String _label;
int _counter = 0;
void increment() {
setState(() {
_counter++;
});
}
void decrement() {
setState(() {
if (_counter > 0) {
_counter--;
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
IconButton(icon: Icon(Icons.remove), onPressed: decrement),
Expanded(
flex: 1,
child: Text(
'$_label',
textAlign: TextAlign.start,
overflow: TextOverflow.clip,
),
),
Text(
'$_counter',
textAlign: TextAlign.start,
overflow: TextOverflow.clip,
),
IconButton(icon: Icon(Icons.add), onPressed: increment),
],
),
],
),
);
}
}
class CounterWidget extends StatefulWidget {
const CounterWidget(this.label, {super.key});
final String label;
@override
State<CounterWidget> createState() => _CounterWidgetState(label);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text('Counter App'),
),
body: Center(
child: const CounterWidget('Things to count'),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: [
// const CounterWidget('Things to count'),
// const CounterWidget('More things to count'),
// ],
// ),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment