I was writing a flutter application but when I want to test it on the Android Emulator (Ctrl+F5) I get an unfixable error. This is part of it:
I/flutter (13782): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (13782): The following assertion was thrown during performResize():
I/flutter (13782): Vertical viewport was given unbounded height.
I/flutter (13782): Viewports expand in the scrolling direction to fill their container. In this case, a vertical
I/flutter (13782): viewport was given an unlimited amount of vertical space in which to expand. This situation
I/flutter (13782): typically happens when a scrollable widget is nested inside another scrollable widget.
I/flutter (13782): If this widget is always nested in a scrollable widget there is no need to use a viewport because
I/flutter (13782): there will always be enough vertical space for the children. In this case, consider using a Column
I/flutter (13782): instead. Otherwise, consider using the "shrinkWrap" property (or a ShrinkWrappingViewport) to size
I/flutter (13782): the height of the viewport to the sum of the heights of its children.
I/flutter (13782):
I/flutter (13782): The relevant error-causing widget was:
I/flutter (13782): ListView (file:///D:/flutterProjects/test_project/test_project/lib/screens/all_obj_screen.dart:19:18)
As you can see in the last line it says the cause of the error is a ListView
in D:/flutterProjects/test_project/test_project/lib/screens/all_obj_screen.dart
. The problem is that I have no ListView
in that file (at the moment, but I had it previously) and that path does not even exist anymore!
If it can help, this is the all_obj_screen.dart
file:
class AllObjScreen extends StatefulWidget {
@override
_AllObjScreenState createState() => _AllObjScreenState();
}
class _AllObjScreenState extends State<AllObjScreen> {
@override
Widget build(BuildContext context) {
final objects = Provider.of<Objs>(context);
return Center(
child: Text(
'${objects.items.length}',
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
),
);
}
}
So I am thinking that the problem is not my code but something about Visual Studio Code. How to fix this problem?
EDIT: I have tried to run the app on both Visual Studio Code and on Android Studio but the problem is the same. I have also tried to reinstall the IDE and flutter but no luck at all.
I have the same problem since version 1.12. Rebooting device clears logs but I hope Flutter will correct this in future versions. This just happend using android devices. In iOS works correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With