0

According to this, a grey screen will appear when a Flutter app crashes due to a runtime error if the app is in release mode, and a red screen if in debug mode.

My app is showing a grey in MOST runtime errors, for example:

List<int> myList =[1,2,3];
int a = myList[5]

This will cause a

List index out of range.

Which is showing a grey screen in my device and the tester mentioned below.

But in one of my tester devices (Samsung s20) this black screen appeared.

Null safety error

Even if the app is deleted from cache and a newer version is installed, the app will open in this image with the same error.

My app isn't connected to any crash report services and the tester forgot how he had the error and in which page.

I'm now blind. Any suggestions on how to debug this? I've tried everything and the user also tried to get the error for a second time but we couldn't.

And why didn't this show a grey screen?

S. Dre
  • 647
  • 1
  • 4
  • 18
Zaid Alazwi
  • 395
  • 3
  • 8

1 Answers1

0

You probably didn't use Scaffold widget. You should wrap with Scaffold your used widget.

  • All my pages are within a scaffold. – Zaid Alazwi May 20 '22 at 21:43
  • but i have dialog that pop up containing some data, it's not warped directly by Scaffold..but that button showing this data is so it's in the widget tree inside a a scaffold or am I missing something? – Zaid Alazwi May 20 '22 at 21:47
  • Is there MaterialApp widget inside your base class? So I mean `runApp(MyApp())` section. – Furkan Abbasioğlu May 20 '22 at 21:55
  • Yes. The top of the tree is a MaterialApp Widget. – Zaid Alazwi May 20 '22 at 21:57
  • 1
    Sorry you were right, my app is 3 months in development and still not released so i have forgotten some basic logic that i thought it's already done... most of my pages are inside a scaffold but the landing page (on error) page isn't, Thank you. – Zaid Alazwi May 28 '22 at 19:15
  • but list out of range error has not any connection with scaffold, please try to post useful content – Dipak Ramoliya Sep 20 '22 at 04:19