Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
df2781ad
Unverified
Commit
df2781ad
authored
Apr 12, 2022
by
Ahmed Masoud
Committed by
GitHub
Apr 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use kDebugMode in error_widget.0.dart example (#93408)
parent
355fd23a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
error_widget.0.dart
examples/api/lib/widgets/framework/error_widget.0.dart
+2
-8
No files found.
examples/api/lib/widgets/framework/error_widget.0.dart
View file @
df2781ad
...
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment