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
d05d3610
Commit
d05d3610
authored
Apr 17, 2017
by
Hans Muller
Committed by
GitHub
Apr 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce didUpdateWidget() @mustCallSuper (#9421)
parent
2480c4d4
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
34 additions
and
10 deletions
+34
-10
activity_indicator.dart
packages/flutter/lib/src/cupertino/activity_indicator.dart
+1
-0
bottom_navigation_bar.dart
packages/flutter/lib/src/material/bottom_navigation_bar.dart
+1
-0
date_picker.dart
packages/flutter/lib/src/material/date_picker.dart
+1
-0
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-0
expand_icon.dart
packages/flutter/lib/src/material/expand_icon.dart
+1
-0
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+1
-0
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+1
-0
time_picker.dart
packages/flutter/lib/src/material/time_picker.dart
+1
-0
async.dart
packages/flutter/lib/src/widgets/async.dart
+2
-0
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+1
-1
gesture_detector.dart
packages/flutter/lib/src/widgets/gesture_detector.dart
+1
-0
image.dart
packages/flutter/lib/src/widgets/image.dart
+1
-0
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+3
-2
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+1
-0
overscroll_indicator.dart
packages/flutter/lib/src/widgets/overscroll_indicator.dart
+1
-0
raw_keyboard_listener.dart
packages/flutter/lib/src/widgets/raw_keyboard_listener.dart
+1
-0
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+1
-0
status_transitions.dart
packages/flutter/lib/src/widgets/status_transitions.dart
+1
-0
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+8
-7
will_pop_scope.dart
packages/flutter/lib/src/widgets/will_pop_scope.dart
+1
-0
build_scope_test.dart
packages/flutter/test/widgets/build_scope_test.dart
+1
-0
independent_widget_layout_test.dart
.../flutter/test/widgets/independent_widget_layout_test.dart
+1
-0
syncing_test.dart
packages/flutter/test/widgets/syncing_test.dart
+1
-0
No files found.
packages/flutter/lib/src/cupertino/activity_indicator.dart
View file @
d05d3610
...
...
@@ -49,6 +49,7 @@ class _CupertinoActivityIndicatorState extends State<CupertinoActivityIndicator>
@override
void
didUpdateWidget
(
CupertinoActivityIndicator
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
animating
!=
oldWidget
.
animating
)
{
if
(
widget
.
animating
)
_controller
.
repeat
();
...
...
packages/flutter/lib/src/material/bottom_navigation_bar.dart
View file @
d05d3610
...
...
@@ -291,6 +291,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
@override
void
didUpdateWidget
(
BottomNavigationBar
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
currentIndex
!=
oldWidget
.
currentIndex
)
{
if
(
widget
.
type
==
BottomNavigationBarType
.
shifting
)
_pushCircle
(
widget
.
currentIndex
);
...
...
packages/flutter/lib/src/material/date_picker.dart
View file @
d05d3610
...
...
@@ -372,6 +372,7 @@ class _MonthPickerState extends State<MonthPicker> {
@override
void
didUpdateWidget
(
MonthPicker
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
selectedDate
!=
oldWidget
.
selectedDate
)
{
_dayPickerController
=
new
PageController
(
initialPage:
_monthDelta
(
widget
.
firstDate
,
widget
.
selectedDate
));
_currentDisplayedMonthDate
=
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
d05d3610
...
...
@@ -480,6 +480,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> {
@override
void
didUpdateWidget
(
DropdownButton
<
T
>
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
_updateSelectedIndex
();
}
...
...
packages/flutter/lib/src/material/expand_icon.dart
View file @
d05d3610
...
...
@@ -84,6 +84,7 @@ class _ExpandIconState extends State<ExpandIcon> with SingleTickerProviderStateM
@override
void
didUpdateWidget
(
ExpandIcon
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
isExpanded
!=
oldWidget
.
isExpanded
)
{
if
(
widget
.
isExpanded
)
{
_controller
.
forward
();
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
d05d3610
...
...
@@ -196,6 +196,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
@override
void
didUpdateWidget
(
_FloatingActionButtonTransition
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
final
bool
oldChildIsNull
=
oldWidget
.
child
==
null
;
final
bool
newChildIsNull
=
widget
.
child
==
null
;
if
(
oldChildIsNull
==
newChildIsNull
&&
oldWidget
.
child
?.
key
==
widget
.
child
?.
key
)
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
d05d3610
...
...
@@ -183,6 +183,7 @@ class _TextFieldState extends State<TextField> {
@override
void
didUpdateWidget
(
TextField
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
controller
==
null
&&
oldWidget
.
controller
!=
null
)
_controller
==
new
TextEditingController
.
fromValue
(
oldWidget
.
controller
.
value
);
else
if
(
widget
.
controller
!=
null
&&
oldWidget
.
controller
==
null
)
...
...
packages/flutter/lib/src/material/time_picker.dart
View file @
d05d3610
...
...
@@ -479,6 +479,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
@override
void
didUpdateWidget
(
_Dial
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
mode
!=
oldWidget
.
mode
&&
!
_dragging
)
_animateTo
(
_getThetaForTime
(
widget
.
selectedTime
));
}
...
...
packages/flutter/lib/src/widgets/async.dart
View file @
d05d3610
...
...
@@ -107,6 +107,7 @@ class _StreamBuilderBaseState<T, S> extends State<StreamBuilderBase<T, S>> {
@override
void
didUpdateWidget
(
StreamBuilderBase
<
T
,
S
>
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
oldWidget
.
stream
!=
widget
.
stream
)
{
if
(
_subscription
!=
null
)
{
_unsubscribe
();
...
...
@@ -419,6 +420,7 @@ class _FutureBuilderState<T> extends State<FutureBuilder<T>> {
@override
void
didUpdateWidget
(
FutureBuilder
<
T
>
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
oldWidget
.
future
!=
widget
.
future
)
{
if
(
_activeCallbackIdentity
!=
null
)
{
_unsubscribe
();
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
d05d3610
...
...
@@ -236,6 +236,7 @@ class EditableTextState extends State<EditableText> implements TextInputClient {
@override
void
didUpdateWidget
(
EditableText
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
controller
!=
oldWidget
.
controller
)
{
oldWidget
.
controller
.
removeListener
(
_didChangeTextEditingValue
);
widget
.
controller
.
addListener
(
_didChangeTextEditingValue
);
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
d05d3610
...
...
@@ -831,7 +831,7 @@ abstract class State<T extends StatefulWidget> {
///
/// If you override this, make sure your method starts with a call to
/// super.didUpdateWidget(oldWidget).
// TODO(abarth): Add @mustCallSuper.
@mustCallSuper
@protected
void
didUpdateWidget
(
covariant
T
oldWidget
)
{
}
...
...
packages/flutter/lib/src/widgets/gesture_detector.dart
View file @
d05d3610
...
...
@@ -368,6 +368,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
@override
void
didUpdateWidget
(
RawGestureDetector
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
_syncAll
(
widget
.
gestures
);
}
...
...
packages/flutter/lib/src/widgets/image.dart
View file @
d05d3610
...
...
@@ -244,6 +244,7 @@ class _ImageState extends State<Image> {
@override
void
didUpdateWidget
(
Image
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
image
!=
oldWidget
.
image
)
_resolveImage
();
}
...
...
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
d05d3610
...
...
@@ -148,6 +148,7 @@ abstract class AnimatedWidgetBaseState<T extends ImplicitlyAnimatedWidget> exten
@override
void
didUpdateWidget
(
T
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
curve
!=
oldWidget
.
curve
)
_updateCurve
();
_controller
.
duration
=
widget
.
duration
;
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
d05d3610
...
...
@@ -716,6 +716,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
@override
void
didUpdateWidget
(
Navigator
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
oldWidget
.
observers
!=
widget
.
observers
)
{
for
(
NavigatorObserver
observer
in
oldWidget
.
observers
)
observer
.
_navigator
=
null
;
...
...
packages/flutter/lib/src/widgets/overscroll_indicator.dart
View file @
d05d3610
...
...
@@ -122,6 +122,7 @@ class _GlowingOverscrollIndicatorState extends State<GlowingOverscrollIndicator>
@override
void
didUpdateWidget
(
GlowingOverscrollIndicator
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
oldWidget
.
color
!=
widget
.
color
||
oldWidget
.
axis
!=
widget
.
axis
)
{
_leadingController
.
color
=
widget
.
color
;
_leadingController
.
axis
=
widget
.
axis
;
...
...
packages/flutter/lib/src/widgets/raw_keyboard_listener.dart
View file @
d05d3610
...
...
@@ -60,6 +60,7 @@ class _RawKeyboardListenerState extends State<RawKeyboardListener> {
@override
void
didUpdateWidget
(
RawKeyboardListener
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
focusNode
!=
oldWidget
.
focusNode
)
{
oldWidget
.
focusNode
.
removeListener
(
_handleFocusChanged
);
widget
.
focusNode
.
addListener
(
_handleFocusChanged
);
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
d05d3610
...
...
@@ -442,6 +442,7 @@ class _ModalScopeState extends State<_ModalScope> {
@override
void
didUpdateWidget
(
_ModalScope
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
assert
(
widget
.
route
==
oldWidget
.
route
);
}
...
...
packages/flutter/lib/src/widgets/status_transitions.dart
View file @
d05d3610
...
...
@@ -39,6 +39,7 @@ class _StatusTransitionState extends State<StatusTransitionWidget> {
@override
void
didUpdateWidget
(
StatusTransitionWidget
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
animation
!=
oldWidget
.
animation
)
{
oldWidget
.
animation
.
removeStatusListener
(
_animationStatusChanged
);
widget
.
animation
.
addStatusListener
(
_animationStatusChanged
);
...
...
packages/flutter/lib/src/widgets/transitions.dart
View file @
d05d3610
...
...
@@ -74,6 +74,7 @@ class _AnimatedState extends State<AnimatedWidget> {
@override
void
didUpdateWidget
(
AnimatedWidget
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
if
(
widget
.
listenable
!=
oldWidget
.
listenable
)
{
oldWidget
.
listenable
.
removeListener
(
_handleChange
);
widget
.
listenable
.
addListener
(
_handleChange
);
...
...
packages/flutter/lib/src/widgets/will_pop_scope.dart
View file @
d05d3610
...
...
@@ -55,6 +55,7 @@ class _WillPopScopeState extends State<WillPopScope> {
@override
void
didUpdateWidget
(
WillPopScope
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
assert
(
_route
==
ModalRoute
.
of
(
context
));
if
(
widget
.
onWillPop
!=
oldWidget
.
onWillPop
&&
_route
!=
null
)
{
if
(
oldWidget
.
onWillPop
!=
null
)
...
...
packages/flutter/test/widgets/build_scope_test.dart
View file @
d05d3610
...
...
@@ -23,6 +23,7 @@ class ProbeWidgetState extends State<ProbeWidget> {
@override
void
didUpdateWidget
(
ProbeWidget
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
setState
(()
{});
}
...
...
packages/flutter/test/widgets/independent_widget_layout_test.dart
View file @
d05d3610
...
...
@@ -78,6 +78,7 @@ class TriggerableState extends State<TriggerableWidget> {
@override
void
didUpdateWidget
(
TriggerableWidget
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
widget
.
trigger
.
callback
=
fire
;
}
...
...
packages/flutter/test/widgets/syncing_test.dart
View file @
d05d3610
...
...
@@ -30,6 +30,7 @@ class TestWidgetState extends State<TestWidget> {
@override
void
didUpdateWidget
(
TestWidget
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
syncedState
=
widget
.
syncedState
;
// we explicitly do NOT sync the persistentState from the new instance
// because we're using that to track whether we got recreated
...
...
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