I am new on flutter. I am using vs code. Sometimes I see that the app is getting stack in a particular event or page. Then I restart debugging on same place it gets stacked again.
And then after trying many times, I just open same codebase into android studio and I run app from android studio into same emulator which one I use before with vs code. Suddenly I am seeing a red screen like following the error message, it gets easier for me to fix issues.
But question is why I cannot see that error red screen when I open the app from vs code? Instead, it just getting stacked.
If you have any idea please give me suggestions?
On VS Code I use following indicator button for starting the app.
VS Code Screnshot
3
Answers
lG Felix
I recommend you to debug you app using command
This command give show you errors in terminal and on screen also
to
r
R
q
I hope this will help you.
Make sure you’re running in debug mode: Ensure you are running the app in debug mode in VS Code. This mode provides more detailed error messages.
Check for FlutterError.onError: If your app has custom error handling that overrides Flutter’s default behavior, ensure you are not suppressing the red error screen. If you want to log errors but still display the red error screen, modify your error handler like this:
Enable structured errors in VS Code: You can enable structured error messages in VS Code by adding the following setting to your settings.json:
This will give you more detailed error information similar to Android Studio.
By following these steps, you should be able to see the same red error overlay on your device while running from VS Code as you do in Android Studio.
Please tell me if you are not.