0

I'm trying to build a Flutter Application. The application mostly consists of ListViews which are filled with data fetched from an API. Randomly the application freezes, not responsive at all, even tapping on buttons which are not part of the current interface (i.e menu). No error messages are shown in the debugger and even hot restart does not work in this case, the application must be stopped and run from start. Does anyone have any idea what may cause this issue? Thanks

Widget _buildMessageDisplay() { return Consumer<ChatScreenProvider>( builder: (context, chatState, child) { return FutureBuilder( builder: (context, projectSnap) { if (projectSnap.connectionState == ConnectionState.done) { return Padding( padding: EdgeInsets.symmetric( horizontal: 4.0, ), child: ListView.builder( physics: ClampingScrollPhysics(), controller: _scrollController, itemCount: chatState.messages.length, reverse: true, itemBuilder: (context, index) { final ct = _buildChatThread(chatState.messages[index]); return ct; }, ), ); } return Text(''); }, future: _getMessages, ); }, ); } 

1 Answer 1

1

I have also encountered the same problem, though restarting and rebuilding usually fixes this for me... Make sure that you have the latest version of flutter, by running flutter upgrade in the terminal or command prompt. Additionally, you could also restart your computer, reinstall the emulators, or even reinstall flutter and perform its setup from scratch. May I know if you are using a simulator or a physical device so that I could try to pinpoint the error? Thanks, and I hope this helps.

Since this error is project specific, I would suggest running flutter clean, which removes unwanted and unused files which could be causing your error

Also, how often does this error occur for you? Is it specific to this project or it is stuck on all projects?

Sign up to request clarification or add additional context in comments.

9 Comments

Thanks for the reply. The error happens randomly on emulators and devices, both on Android and iOS. It seems very random, but when it happens everything freezes, even notifications are not received. My only solution in this case is restarting from scratch.
This error is happening only on my current project. Maybe it has something to do on how I've used ListViews, not sure. I'm going to edit the post including an example on how I've used the ListViews
ok.. this could be a problem with flutter. As far as I understand, this is happening not only to this specific project but for all others too? Also, did u run flutter upgrade
right so I think this is going to be a small problem which you should be able to fix easily
As far as I understand, your simulator is not responsive right? and even when you try to exit the app it doesnt allow you and doesnt respond?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.