Unverified Commit df2781ad authored by Ahmed Masoud's avatar Ahmed Masoud Committed by GitHub

Use kDebugMode in error_widget.0.dart example (#93408)

parent 355fd23a
......@@ -4,21 +4,15 @@
// Flutter code sample for ErrorWidget
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
// Set the ErrorWidget's builder before the app is started.
ErrorWidget.builder = (FlutterErrorDetails details) {
// This is how to tell if you're in debug mode: Assertions are only executed in
// debug mode.
bool inDebug = false;
assert(() {
inDebug = true;
return true;
}());
// If we're in debug mode, use the normal error widget which shows the error
// message:
if (inDebug) {
if (kDebugMode) {
return ErrorWidget(details.exception);
}
// In release builds, show a yellow-on-blue message instead:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment