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
8f28864b
Commit
8f28864b
authored
Mar 31, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3001 from abarth/moar_error
Improve setState-after-dispose error message
parents
4df24abb
bfc35325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+2
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+13
-7
No files found.
packages/flutter/lib/src/painting/text_style.dart
View file @
8f28864b
...
...
@@ -59,8 +59,8 @@ class TextStyle {
/// The height of this text span, as a multiple of the font size.
///
/// If applied to the root [TextSpan], this value sets the line height, which
/// is the minimum distance between
each text baselines, as multiple of the
/// font size.
/// is the minimum distance between
subsequent text baselines, as multiple of
///
the
font size.
final
double
height
;
/// The decorations to paint near the text (e.g., an underline).
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
8f28864b
...
...
@@ -394,13 +394,19 @@ abstract class State<T extends StatefulWidget> {
if
(
_debugLifecycleState
==
_StateLifecycle
.
defunct
)
{
throw
new
FlutterError
(
'setState() called after dispose():
$this
\n
'
'This error happens if you call setState() on State object for a widget that
\n
'
'no longer appears in the widget tree (e.g., whose parent widget no longer
\n
'
'includes the widget in its build). This error can occur when code calls
\n
'
'setState() from a timer or an animation callback. The preferred solution is
\n
'
'to cancel the timer or stop listening to the animation in the dispose()
\n
'
'callback. Another solution is to check the "mounted" property of this
\n
'
'object before calling setState() to ensure the object is still in the tree.'
'This error happens if you call setState() on State object for a widget that '
'no longer appears in the widget tree (e.g., whose parent widget no longer '
'includes the widget in its build). This error can occur when code calls '
'setState() from a timer or an animation callback. The preferred solution is '
'to cancel the timer or stop listening to the animation in the dispose() '
'callback. Another solution is to check the "mounted" property of this '
'object before calling setState() to ensure the object is still in the '
'tree.
\n
'
'
\n
'
'This error might indicate a memory leak if setState() is being called '
'because another object is retaining a reference to this State object '
'after it has been removed from the tree. To avoid memory leaks, '
'consider breaking the reference to this object during dipose().'
);
}
return
true
;
...
...
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