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
59c3ecdc
Commit
59c3ecdc
authored
Dec 04, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the asset for build functions that return null
Fixes #689
parent
42eafce0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+12
-2
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
59c3ecdc
...
...
@@ -416,7 +416,7 @@ abstract class State<T extends StatefulComponent> {
/// Called when an Inherited widget in the ancestor chain has changed. Usually
/// there is nothing to do here; whenever this is called, build() is also
/// called.
/// called.
void
dependenciesChanged
(
Type
affectedWidgetType
)
{
}
String
toString
()
{
...
...
@@ -1094,7 +1094,17 @@ abstract class ComponentElement<T extends Widget> extends BuildableElement<T> {
Widget
built
;
try
{
built
=
_builder
(
this
);
assert
(
built
!=
null
);
assert
(()
{
if
(
built
==
null
)
{
debugPrint
(
'Widget:
$widget
'
);
assert
(()
{
'A build function returned null. Build functions must never return null.'
'The offending widget is displayed above.'
;
return
false
;
});
}
return
true
;
});
}
catch
(
e
,
stack
)
{
_debugReportException
(
'building
$_widget
'
,
e
,
stack
);
built
=
new
ErrorWidget
();
...
...
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