Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter showing old errors

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.

like image 716
AlessioF Avatar asked Dec 17 '22 14:12

AlessioF


1 Answers

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.

like image 125
Joel Ollé Ripoll Avatar answered Dec 21 '22 11:12

Joel Ollé Ripoll