Better Error Screen
void main() { ErrorWidget.builder = (FlutterErrorDetails details) { bool inDebug = false; assert(() { inDebug = true; return true; } if(inDebug) { return ErrorWidget(details.exception); } return Material( color: Colors.green.shade200, child: Center( child: Text(details.exception.toString()), style: const TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 20 ) ) ); }; runApp(const MyApp()); }