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
a5b31391
Commit
a5b31391
authored
Jan 15, 2018
by
Vyacheslav Egorov
Committed by
Siva
Jan 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use void as type argument instead of Null where appropriate
parent
84580b54
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
42 additions
and
42 deletions
+42
-42
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+1
-1
long_press.dart
packages/flutter/lib/src/gestures/long_press.dart
+1
-1
monodrag.dart
packages/flutter/lib/src/gestures/monodrag.dart
+7
-7
multitap.dart
packages/flutter/lib/src/gestures/multitap.dart
+6
-6
scale.dart
packages/flutter/lib/src/gestures/scale.dart
+4
-4
tap.dart
packages/flutter/lib/src/gestures/tap.dart
+5
-5
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-1
expansion_tile.dart
packages/flutter/lib/src/material/expansion_tile.dart
+1
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-1
refresh_indicator.dart
packages/flutter/lib/src/material/refresh_indicator.dart
+2
-2
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+2
-2
image_provider.dart
packages/flutter/lib/src/painting/image_provider.dart
+1
-1
image_resolution.dart
packages/flutter/lib/src/painting/image_resolution.dart
+1
-1
image_stream.dart
packages/flutter/lib/src/painting/image_stream.dart
+2
-2
asset_bundle.dart
packages/flutter/lib/src/services/asset_bundle.dart
+1
-1
animated_list.dart
packages/flutter/lib/src/widgets/animated_list.dart
+2
-2
async.dart
packages/flutter/lib/src/widgets/async.dart
+1
-1
capture_output.dart
packages/flutter/test/foundation/capture_output.dart
+1
-1
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+2
-2
No files found.
examples/stocks/lib/stock_settings.dart
View file @
a5b31391
...
@@ -85,7 +85,7 @@ class StockSettingsState extends State<StockSettings> {
...
@@ -85,7 +85,7 @@ class StockSettingsState extends State<StockSettings> {
),
),
]
]
)
)
).
then
<
Null
>(
_handleOptimismChanged
);
).
then
<
void
>(
_handleOptimismChanged
);
break
;
break
;
}
}
}
}
...
...
packages/flutter/lib/src/gestures/long_press.dart
View file @
a5b31391
...
@@ -26,7 +26,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
...
@@ -26,7 +26,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
void
didExceedDeadline
()
{
void
didExceedDeadline
()
{
resolve
(
GestureDisposition
.
accepted
);
resolve
(
GestureDisposition
.
accepted
);
if
(
onLongPress
!=
null
)
if
(
onLongPress
!=
null
)
invokeCallback
<
Null
>(
'onLongPress'
,
onLongPress
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onLongPress'
,
onLongPress
);
}
}
@override
@override
...
...
packages/flutter/lib/src/gestures/monodrag.dart
View file @
a5b31391
...
@@ -120,7 +120,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -120,7 +120,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
_pendingDragOffset
=
Offset
.
zero
;
_pendingDragOffset
=
Offset
.
zero
;
_lastPendingEventTimestamp
=
event
.
timeStamp
;
_lastPendingEventTimestamp
=
event
.
timeStamp
;
if
(
onDown
!=
null
)
if
(
onDown
!=
null
)
invokeCallback
<
Null
>(
'onDown'
,
()
=>
onDown
(
new
DragDownDetails
(
globalPosition:
_initialPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onDown'
,
()
=>
onDown
(
new
DragDownDetails
(
globalPosition:
_initialPosition
)));
}
else
if
(
_state
==
_DragState
.
accepted
)
{
}
else
if
(
_state
==
_DragState
.
accepted
)
{
resolve
(
GestureDisposition
.
accepted
);
resolve
(
GestureDisposition
.
accepted
);
}
}
...
@@ -140,7 +140,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -140,7 +140,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
final
Offset
delta
=
event
.
delta
;
final
Offset
delta
=
event
.
delta
;
if
(
_state
==
_DragState
.
accepted
)
{
if
(
_state
==
_DragState
.
accepted
)
{
if
(
onUpdate
!=
null
)
{
if
(
onUpdate
!=
null
)
{
invokeCallback
<
Null
>(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
sourceTimeStamp:
event
.
timeStamp
,
sourceTimeStamp:
event
.
timeStamp
,
delta:
_getDeltaForDetails
(
delta
),
delta:
_getDeltaForDetails
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
...
@@ -166,13 +166,13 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -166,13 +166,13 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
_pendingDragOffset
=
Offset
.
zero
;
_pendingDragOffset
=
Offset
.
zero
;
_lastPendingEventTimestamp
=
null
;
_lastPendingEventTimestamp
=
null
;
if
(
onStart
!=
null
)
{
if
(
onStart
!=
null
)
{
invokeCallback
<
Null
>(
'onStart'
,
()
=>
onStart
(
new
DragStartDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onStart'
,
()
=>
onStart
(
new
DragStartDetails
(
sourceTimeStamp:
timestamp
,
sourceTimeStamp:
timestamp
,
globalPosition:
_initialPosition
,
globalPosition:
_initialPosition
,
)));
)));
}
}
if
(
delta
!=
Offset
.
zero
&&
onUpdate
!=
null
)
{
if
(
delta
!=
Offset
.
zero
&&
onUpdate
!=
null
)
{
invokeCallback
<
Null
>(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
sourceTimeStamp:
timestamp
,
sourceTimeStamp:
timestamp
,
delta:
_getDeltaForDetails
(
delta
),
delta:
_getDeltaForDetails
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
...
@@ -193,7 +193,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -193,7 +193,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
resolve
(
GestureDisposition
.
rejected
);
resolve
(
GestureDisposition
.
rejected
);
_state
=
_DragState
.
ready
;
_state
=
_DragState
.
ready
;
if
(
onCancel
!=
null
)
if
(
onCancel
!=
null
)
invokeCallback
<
Null
>(
'onCancel'
,
onCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onCancel'
,
onCancel
);
return
;
return
;
}
}
final
bool
wasAccepted
=
(
_state
==
_DragState
.
accepted
);
final
bool
wasAccepted
=
(
_state
==
_DragState
.
accepted
);
...
@@ -206,14 +206,14 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -206,14 +206,14 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
if
(
estimate
!=
null
&&
_isFlingGesture
(
estimate
))
{
if
(
estimate
!=
null
&&
_isFlingGesture
(
estimate
))
{
final
Velocity
velocity
=
new
Velocity
(
pixelsPerSecond:
estimate
.
pixelsPerSecond
)
final
Velocity
velocity
=
new
Velocity
(
pixelsPerSecond:
estimate
.
pixelsPerSecond
)
.
clampMagnitude
(
minFlingVelocity
??
kMinFlingVelocity
,
maxFlingVelocity
??
kMaxFlingVelocity
);
.
clampMagnitude
(
minFlingVelocity
??
kMinFlingVelocity
,
maxFlingVelocity
??
kMaxFlingVelocity
);
invokeCallback
<
Null
>(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
velocity:
velocity
,
velocity:
velocity
,
primaryVelocity:
_getPrimaryValueFromOffset
(
velocity
.
pixelsPerSecond
),
primaryVelocity:
_getPrimaryValueFromOffset
(
velocity
.
pixelsPerSecond
),
)),
debugReport:
()
{
)),
debugReport:
()
{
return
'
$estimate
; fling at
$velocity
.'
;
return
'
$estimate
; fling at
$velocity
.'
;
});
});
}
else
{
}
else
{
invokeCallback
<
Null
>(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
velocity:
Velocity
.
zero
,
velocity:
Velocity
.
zero
,
primaryVelocity:
0.0
,
primaryVelocity:
0.0
,
)),
debugReport:
()
{
)),
debugReport:
()
{
...
...
packages/flutter/lib/src/gestures/multitap.dart
View file @
a5b31391
...
@@ -194,7 +194,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
...
@@ -194,7 +194,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
_freezeTracker
(
tracker
);
_freezeTracker
(
tracker
);
_trackers
.
remove
(
tracker
.
pointer
);
_trackers
.
remove
(
tracker
.
pointer
);
if
(
onDoubleTap
!=
null
)
if
(
onDoubleTap
!=
null
)
invokeCallback
<
Null
>(
'onDoubleTap'
,
onDoubleTap
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onDoubleTap'
,
onDoubleTap
);
_reset
();
_reset
();
}
}
...
@@ -353,7 +353,7 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
...
@@ -353,7 +353,7 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
longTapDelay:
longTapDelay
longTapDelay:
longTapDelay
);
);
if
(
onTapDown
!=
null
)
if
(
onTapDown
!=
null
)
invokeCallback
<
Null
>(
'onTapDown'
,
()
=>
onTapDown
(
event
.
pointer
,
new
TapDownDetails
(
globalPosition:
event
.
position
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onTapDown'
,
()
=>
onTapDown
(
event
.
pointer
,
new
TapDownDetails
(
globalPosition:
event
.
position
)));
}
}
@override
@override
...
@@ -373,22 +373,22 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
...
@@ -373,22 +373,22 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
assert
(
_gestureMap
.
containsKey
(
pointer
));
assert
(
_gestureMap
.
containsKey
(
pointer
));
_gestureMap
.
remove
(
pointer
);
_gestureMap
.
remove
(
pointer
);
if
(
onTapCancel
!=
null
)
if
(
onTapCancel
!=
null
)
invokeCallback
<
Null
>(
'onTapCancel'
,
()
=>
onTapCancel
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onTapCancel'
,
()
=>
onTapCancel
(
pointer
));
}
}
void
_dispatchTap
(
int
pointer
,
Offset
globalPosition
)
{
void
_dispatchTap
(
int
pointer
,
Offset
globalPosition
)
{
assert
(
_gestureMap
.
containsKey
(
pointer
));
assert
(
_gestureMap
.
containsKey
(
pointer
));
_gestureMap
.
remove
(
pointer
);
_gestureMap
.
remove
(
pointer
);
if
(
onTapUp
!=
null
)
if
(
onTapUp
!=
null
)
invokeCallback
<
Null
>(
'onTapUp'
,
()
=>
onTapUp
(
pointer
,
new
TapUpDetails
(
globalPosition:
globalPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onTapUp'
,
()
=>
onTapUp
(
pointer
,
new
TapUpDetails
(
globalPosition:
globalPosition
)));
if
(
onTap
!=
null
)
if
(
onTap
!=
null
)
invokeCallback
<
Null
>(
'onTap'
,
()
=>
onTap
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onTap'
,
()
=>
onTap
(
pointer
));
}
}
void
_dispatchLongTap
(
int
pointer
,
Offset
lastPosition
)
{
void
_dispatchLongTap
(
int
pointer
,
Offset
lastPosition
)
{
assert
(
_gestureMap
.
containsKey
(
pointer
));
assert
(
_gestureMap
.
containsKey
(
pointer
));
if
(
onLongTapDown
!=
null
)
if
(
onLongTapDown
!=
null
)
invokeCallback
<
Null
>(
'onLongTapDown'
,
()
=>
onLongTapDown
(
pointer
,
new
TapDownDetails
(
globalPosition:
lastPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onLongTapDown'
,
()
=>
onLongTapDown
(
pointer
,
new
TapDownDetails
(
globalPosition:
lastPosition
)));
}
}
@override
@override
...
...
packages/flutter/lib/src/gestures/scale.dart
View file @
a5b31391
...
@@ -200,9 +200,9 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -200,9 +200,9 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
final
Offset
pixelsPerSecond
=
velocity
.
pixelsPerSecond
;
final
Offset
pixelsPerSecond
=
velocity
.
pixelsPerSecond
;
if
(
pixelsPerSecond
.
distanceSquared
>
kMaxFlingVelocity
*
kMaxFlingVelocity
)
if
(
pixelsPerSecond
.
distanceSquared
>
kMaxFlingVelocity
*
kMaxFlingVelocity
)
velocity
=
new
Velocity
(
pixelsPerSecond:
(
pixelsPerSecond
/
pixelsPerSecond
.
distance
)
*
kMaxFlingVelocity
);
velocity
=
new
Velocity
(
pixelsPerSecond:
(
pixelsPerSecond
/
pixelsPerSecond
.
distance
)
*
kMaxFlingVelocity
);
invokeCallback
<
Null
>(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
velocity
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
velocity
)));
}
else
{
}
else
{
invokeCallback
<
Null
>(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
Velocity
.
zero
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
Velocity
.
zero
)));
}
}
}
}
_state
=
_ScaleState
.
accepted
;
_state
=
_ScaleState
.
accepted
;
...
@@ -230,13 +230,13 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
...
@@ -230,13 +230,13 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
}
}
if
(
_state
==
_ScaleState
.
started
&&
onUpdate
!=
null
)
if
(
_state
==
_ScaleState
.
started
&&
onUpdate
!=
null
)
invokeCallback
<
Null
>(
'onUpdate'
,
()
=>
onUpdate
(
new
ScaleUpdateDetails
(
scale:
_scaleFactor
,
focalPoint:
_currentFocalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onUpdate'
,
()
=>
onUpdate
(
new
ScaleUpdateDetails
(
scale:
_scaleFactor
,
focalPoint:
_currentFocalPoint
)));
}
}
void
_dispatchOnStartCallbackIfNeeded
()
{
void
_dispatchOnStartCallbackIfNeeded
()
{
assert
(
_state
==
_ScaleState
.
started
);
assert
(
_state
==
_ScaleState
.
started
);
if
(
onStart
!=
null
)
if
(
onStart
!=
null
)
invokeCallback
<
Null
>(
'onStart'
,
()
=>
onStart
(
new
ScaleStartDetails
(
focalPoint:
_currentFocalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
void
>(
'onStart'
,
()
=>
onStart
(
new
ScaleStartDetails
(
focalPoint:
_currentFocalPoint
)));
}
}
@override
@override
...
...
packages/flutter/lib/src/gestures/tap.dart
View file @
a5b31391
...
@@ -103,7 +103,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
...
@@ -103,7 +103,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
// This can happen if the superclass decides the primary pointer
// This can happen if the superclass decides the primary pointer
// exceeded the touch slop, or if the recognizer is disposed.
// exceeded the touch slop, or if the recognizer is disposed.
if
(
onTapCancel
!=
null
)
if
(
onTapCancel
!=
null
)
invokeCallback
<
Null
>(
'spontaneous onTapCancel'
,
onTapCancel
);
invokeCallback
<
void
>(
'spontaneous onTapCancel'
,
onTapCancel
);
_reset
();
_reset
();
}
}
super
.
resolve
(
disposition
);
super
.
resolve
(
disposition
);
...
@@ -131,7 +131,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
...
@@ -131,7 +131,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
// Another gesture won the arena.
// Another gesture won the arena.
assert
(
state
!=
GestureRecognizerState
.
possible
);
assert
(
state
!=
GestureRecognizerState
.
possible
);
if
(
onTapCancel
!=
null
)
if
(
onTapCancel
!=
null
)
invokeCallback
<
Null
>(
'forced onTapCancel'
,
onTapCancel
);
invokeCallback
<
void
>(
'forced onTapCancel'
,
onTapCancel
);
_reset
();
_reset
();
}
}
}
}
...
@@ -139,7 +139,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
...
@@ -139,7 +139,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
void
_checkDown
()
{
void
_checkDown
()
{
if
(!
_sentTapDown
)
{
if
(!
_sentTapDown
)
{
if
(
onTapDown
!=
null
)
if
(
onTapDown
!=
null
)
invokeCallback
<
Null
>(
'onTapDown'
,
()
{
onTapDown
(
new
TapDownDetails
(
globalPosition:
initialPosition
));
});
invokeCallback
<
void
>(
'onTapDown'
,
()
{
onTapDown
(
new
TapDownDetails
(
globalPosition:
initialPosition
));
});
_sentTapDown
=
true
;
_sentTapDown
=
true
;
}
}
}
}
...
@@ -156,9 +156,9 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
...
@@ -156,9 +156,9 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
return
;
return
;
}
}
if
(
onTapUp
!=
null
)
if
(
onTapUp
!=
null
)
invokeCallback
<
Null
>(
'onTapUp'
,
()
{
onTapUp
(
new
TapUpDetails
(
globalPosition:
_finalPosition
));
});
invokeCallback
<
void
>(
'onTapUp'
,
()
{
onTapUp
(
new
TapUpDetails
(
globalPosition:
_finalPosition
));
});
if
(
onTap
!=
null
)
if
(
onTap
!=
null
)
invokeCallback
<
Null
>(
'onTap'
,
onTap
);
invokeCallback
<
void
>(
'onTap'
,
onTap
);
_reset
();
_reset
();
}
}
}
}
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
a5b31391
...
@@ -578,7 +578,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
...
@@ -578,7 +578,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
barrierLabel:
MaterialLocalizations
.
of
(
context
).
modalBarrierDismissLabel
,
barrierLabel:
MaterialLocalizations
.
of
(
context
).
modalBarrierDismissLabel
,
);
);
Navigator
.
push
(
context
,
_dropdownRoute
).
then
<
Null
>((
_DropdownRouteResult
<
T
>
newValue
)
{
Navigator
.
push
(
context
,
_dropdownRoute
).
then
<
void
>((
_DropdownRouteResult
<
T
>
newValue
)
{
_dropdownRoute
=
null
;
_dropdownRoute
=
null
;
if
(!
mounted
||
newValue
==
null
)
if
(!
mounted
||
newValue
==
null
)
return
null
;
return
null
;
...
...
packages/flutter/lib/src/material/expansion_tile.dart
View file @
a5b31391
...
@@ -120,7 +120,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
...
@@ -120,7 +120,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
if
(
_isExpanded
)
if
(
_isExpanded
)
_controller
.
forward
();
_controller
.
forward
();
else
else
_controller
.
reverse
().
then
<
Null
>((
Null
value
)
{
_controller
.
reverse
().
then
<
void
>((
Null
value
)
{
setState
(()
{
setState
(()
{
// Rebuild without widget.children.
// Rebuild without widget.children.
});
});
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
a5b31391
...
@@ -813,7 +813,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
...
@@ -813,7 +813,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
initialValue:
widget
.
initialValue
,
initialValue:
widget
.
initialValue
,
position:
position
,
position:
position
,
)
)
.
then
<
Null
>((
T
newValue
)
{
.
then
<
void
>((
T
newValue
)
{
if
(!
mounted
||
newValue
==
null
)
if
(!
mounted
||
newValue
==
null
)
return
null
;
return
null
;
if
(
widget
.
onSelected
!=
null
)
if
(
widget
.
onSelected
!=
null
)
...
...
packages/flutter/lib/src/material/refresh_indicator.dart
View file @
a5b31391
...
@@ -119,7 +119,7 @@ class RefreshIndicator extends StatefulWidget {
...
@@ -119,7 +119,7 @@ class RefreshIndicator extends StatefulWidget {
/// The progress indicator's background color. The current theme's
/// The progress indicator's background color. The current theme's
/// [ThemeData.canvasColor] by default.
/// [ThemeData.canvasColor] by default.
final
Color
backgroundColor
;
final
Color
backgroundColor
;
/// A check that specifies whether a [ScrollNotification] should be
/// A check that specifies whether a [ScrollNotification] should be
/// handled by this widget.
/// handled by this widget.
///
///
...
@@ -322,7 +322,7 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
...
@@ -322,7 +322,7 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
_mode
=
_RefreshIndicatorMode
.
snap
;
_mode
=
_RefreshIndicatorMode
.
snap
;
_positionController
_positionController
.
animateTo
(
1.0
/
_kDragSizeFactorLimit
,
duration:
_kIndicatorSnapDuration
)
.
animateTo
(
1.0
/
_kDragSizeFactorLimit
,
duration:
_kIndicatorSnapDuration
)
.
then
<
Null
>((
Null
value
)
{
.
then
<
void
>((
Null
value
)
{
if
(
mounted
&&
_mode
==
_RefreshIndicatorMode
.
snap
)
{
if
(
mounted
&&
_mode
==
_RefreshIndicatorMode
.
snap
)
{
assert
(
widget
.
onRefresh
!=
null
);
assert
(
widget
.
onRefresh
!=
null
);
setState
(()
{
setState
(()
{
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
a5b31391
...
@@ -369,7 +369,7 @@ class Scaffold extends StatefulWidget {
...
@@ -369,7 +369,7 @@ class Scaffold extends StatefulWidget {
/// A panel displayed to the side of the [body], often hidden on mobile
/// A panel displayed to the side of the [body], often hidden on mobile
/// devices. Swipes in from either left-to-right ([TextDirection.ltr]) or
/// devices. Swipes in from either left-to-right ([TextDirection.ltr]) or
/// right-to-left ([TextDirection.rtl])
/// right-to-left ([TextDirection.rtl])
///
///
/// In the uncommon case that you wish to open the drawer manually, use the
/// In the uncommon case that you wish to open the drawer manually, use the
/// [ScaffoldState.openDrawer] function.
/// [ScaffoldState.openDrawer] function.
///
///
...
@@ -678,7 +678,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
...
@@ -678,7 +678,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
if
(
_snackBars
.
isEmpty
||
_snackBarController
.
status
==
AnimationStatus
.
dismissed
)
if
(
_snackBars
.
isEmpty
||
_snackBarController
.
status
==
AnimationStatus
.
dismissed
)
return
;
return
;
final
Completer
<
SnackBarClosedReason
>
completer
=
_snackBars
.
first
.
_completer
;
final
Completer
<
SnackBarClosedReason
>
completer
=
_snackBars
.
first
.
_completer
;
_snackBarController
.
reverse
().
then
<
Null
>((
Null
_
)
{
_snackBarController
.
reverse
().
then
<
void
>((
Null
_
)
{
assert
(
mounted
);
assert
(
mounted
);
if
(!
completer
.
isCompleted
)
if
(!
completer
.
isCompleted
)
completer
.
complete
(
reason
);
completer
.
complete
(
reason
);
...
...
packages/flutter/lib/src/painting/image_provider.dart
View file @
a5b31391
...
@@ -261,7 +261,7 @@ abstract class ImageProvider<T> {
...
@@ -261,7 +261,7 @@ abstract class ImageProvider<T> {
assert
(
configuration
!=
null
);
assert
(
configuration
!=
null
);
final
ImageStream
stream
=
new
ImageStream
();
final
ImageStream
stream
=
new
ImageStream
();
T
obtainedKey
;
T
obtainedKey
;
obtainKey
(
configuration
).
then
<
Null
>((
T
key
)
{
obtainKey
(
configuration
).
then
<
void
>((
T
key
)
{
obtainedKey
=
key
;
obtainedKey
=
key
;
stream
.
setCompleter
(
PaintingBinding
.
instance
.
imageCache
.
putIfAbsent
(
key
,
()
=>
load
(
key
)));
stream
.
setCompleter
(
PaintingBinding
.
instance
.
imageCache
.
putIfAbsent
(
key
,
()
=>
load
(
key
)));
}).
catchError
(
}).
catchError
(
...
...
packages/flutter/lib/src/painting/image_resolution.dart
View file @
a5b31391
...
@@ -166,7 +166,7 @@ class AssetImage extends AssetBundleImageProvider {
...
@@ -166,7 +166,7 @@ class AssetImage extends AssetBundleImageProvider {
final
AssetBundle
chosenBundle
=
bundle
??
configuration
.
bundle
??
rootBundle
;
final
AssetBundle
chosenBundle
=
bundle
??
configuration
.
bundle
??
rootBundle
;
Completer
<
AssetBundleImageKey
>
completer
;
Completer
<
AssetBundleImageKey
>
completer
;
Future
<
AssetBundleImageKey
>
result
;
Future
<
AssetBundleImageKey
>
result
;
chosenBundle
.
loadStructuredData
<
Map
<
String
,
List
<
String
>>>(
_kAssetManifestFileName
,
_manifestParser
).
then
<
Null
>(
chosenBundle
.
loadStructuredData
<
Map
<
String
,
List
<
String
>>>(
_kAssetManifestFileName
,
_manifestParser
).
then
<
void
>(
(
Map
<
String
,
List
<
String
>>
manifest
)
{
(
Map
<
String
,
List
<
String
>>
manifest
)
{
final
String
chosenName
=
_chooseVariant
(
final
String
chosenName
=
_chooseVariant
(
keyName
,
keyName
,
...
...
packages/flutter/lib/src/painting/image_stream.dart
View file @
a5b31391
...
@@ -270,7 +270,7 @@ class OneFrameImageStreamCompleter extends ImageStreamCompleter {
...
@@ -270,7 +270,7 @@ class OneFrameImageStreamCompleter extends ImageStreamCompleter {
/// FlutterErrorDetails]).
/// FlutterErrorDetails]).
OneFrameImageStreamCompleter
(
Future
<
ImageInfo
>
image
,
{
InformationCollector
informationCollector
})
OneFrameImageStreamCompleter
(
Future
<
ImageInfo
>
image
,
{
InformationCollector
informationCollector
})
:
assert
(
image
!=
null
)
{
:
assert
(
image
!=
null
)
{
image
.
then
<
Null
>(
setImage
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
image
.
then
<
void
>(
setImage
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
FlutterError
.
reportError
(
new
FlutterErrorDetails
(
FlutterError
.
reportError
(
new
FlutterErrorDetails
(
exception:
error
,
exception:
error
,
stack:
stack
,
stack:
stack
,
...
@@ -333,7 +333,7 @@ class MultiFrameImageStreamCompleter extends ImageStreamCompleter {
...
@@ -333,7 +333,7 @@ class MultiFrameImageStreamCompleter extends ImageStreamCompleter {
_scale
=
scale
,
_scale
=
scale
,
_framesEmitted
=
0
,
_framesEmitted
=
0
,
_timer
=
null
{
_timer
=
null
{
codec
.
then
<
Null
>(
_handleCodecReady
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
codec
.
then
<
void
>(
_handleCodecReady
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
FlutterError
.
reportError
(
new
FlutterErrorDetails
(
FlutterError
.
reportError
(
new
FlutterErrorDetails
(
exception:
error
,
exception:
error
,
stack:
stack
,
stack:
stack
,
...
...
packages/flutter/lib/src/services/asset_bundle.dart
View file @
a5b31391
...
@@ -181,7 +181,7 @@ abstract class CachingAssetBundle extends AssetBundle {
...
@@ -181,7 +181,7 @@ abstract class CachingAssetBundle extends AssetBundle {
return
_structuredDataCache
[
key
];
return
_structuredDataCache
[
key
];
Completer
<
T
>
completer
;
Completer
<
T
>
completer
;
Future
<
T
>
result
;
Future
<
T
>
result
;
loadString
(
key
,
cache:
false
).
then
<
T
>(
parser
).
then
<
Null
>((
T
value
)
{
loadString
(
key
,
cache:
false
).
then
<
T
>(
parser
).
then
<
void
>((
T
value
)
{
result
=
new
SynchronousFuture
<
T
>(
value
);
result
=
new
SynchronousFuture
<
T
>(
value
);
_structuredDataCache
[
key
]
=
result
;
_structuredDataCache
[
key
]
=
result
;
if
(
completer
!=
null
)
{
if
(
completer
!=
null
)
{
...
...
packages/flutter/lib/src/widgets/animated_list.dart
View file @
a5b31391
...
@@ -298,7 +298,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
...
@@ -298,7 +298,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
_itemsCount
+=
1
;
_itemsCount
+=
1
;
});
});
controller
.
forward
().
then
<
Null
>((
Null
value
)
{
controller
.
forward
().
then
<
void
>((
Null
value
)
{
_removeActiveItemAt
(
_incomingItems
,
incomingItem
.
itemIndex
).
controller
.
dispose
();
_removeActiveItemAt
(
_incomingItems
,
incomingItem
.
itemIndex
).
controller
.
dispose
();
});
});
}
}
...
@@ -333,7 +333,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
...
@@ -333,7 +333,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
..
sort
();
..
sort
();
});
});
controller
.
reverse
().
then
<
Null
>((
Null
value
)
{
controller
.
reverse
().
then
<
void
>((
Null
value
)
{
_removeActiveItemAt
(
_outgoingItems
,
outgoingItem
.
itemIndex
).
controller
.
dispose
();
_removeActiveItemAt
(
_outgoingItems
,
outgoingItem
.
itemIndex
).
controller
.
dispose
();
// Decrement the incoming and outgoing item indices to account
// Decrement the incoming and outgoing item indices to account
...
...
packages/flutter/lib/src/widgets/async.dart
View file @
a5b31391
...
@@ -513,7 +513,7 @@ class _FutureBuilderState<T> extends State<FutureBuilder<T>> {
...
@@ -513,7 +513,7 @@ class _FutureBuilderState<T> extends State<FutureBuilder<T>> {
if
(
widget
.
future
!=
null
)
{
if
(
widget
.
future
!=
null
)
{
final
Object
callbackIdentity
=
new
Object
();
final
Object
callbackIdentity
=
new
Object
();
_activeCallbackIdentity
=
callbackIdentity
;
_activeCallbackIdentity
=
callbackIdentity
;
widget
.
future
.
then
<
Null
>((
T
data
)
{
widget
.
future
.
then
<
void
>((
T
data
)
{
if
(
_activeCallbackIdentity
==
callbackIdentity
)
{
if
(
_activeCallbackIdentity
==
callbackIdentity
)
{
setState
(()
{
setState
(()
{
_snapshot
=
new
AsyncSnapshot
<
T
>.
withData
(
ConnectionState
.
done
,
data
);
_snapshot
=
new
AsyncSnapshot
<
T
>.
withData
(
ConnectionState
.
done
,
data
);
...
...
packages/flutter/test/foundation/capture_output.dart
View file @
a5b31391
...
@@ -8,7 +8,7 @@ import 'dart:ui' show VoidCallback;
...
@@ -8,7 +8,7 @@ import 'dart:ui' show VoidCallback;
List
<
String
>
captureOutput
(
VoidCallback
fn
)
{
List
<
String
>
captureOutput
(
VoidCallback
fn
)
{
final
List
<
String
>
log
=
<
String
>[];
final
List
<
String
>
log
=
<
String
>[];
runZoned
<
Null
>(
fn
,
zoneSpecification:
new
ZoneSpecification
(
runZoned
<
void
>(
fn
,
zoneSpecification:
new
ZoneSpecification
(
print:
(
Zone
self
,
print:
(
Zone
self
,
ZoneDelegate
parent
,
ZoneDelegate
parent
,
Zone
zone
,
Zone
zone
,
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
a5b31391
...
@@ -90,7 +90,7 @@ class TestAssetBundle extends CachingAssetBundle {
...
@@ -90,7 +90,7 @@ class TestAssetBundle extends CachingAssetBundle {
class
FakeImageStreamCompleter
extends
ImageStreamCompleter
{
class
FakeImageStreamCompleter
extends
ImageStreamCompleter
{
FakeImageStreamCompleter
(
Future
<
ImageInfo
>
image
)
{
FakeImageStreamCompleter
(
Future
<
ImageInfo
>
image
)
{
image
.
then
<
Null
>(
setImage
);
image
.
then
<
void
>(
setImage
);
}
}
}
}
...
@@ -100,7 +100,7 @@ class TestAssetImage extends AssetImage {
...
@@ -100,7 +100,7 @@ class TestAssetImage extends AssetImage {
@override
@override
ImageStreamCompleter
load
(
AssetBundleImageKey
key
)
{
ImageStreamCompleter
load
(
AssetBundleImageKey
key
)
{
ImageInfo
imageInfo
;
ImageInfo
imageInfo
;
key
.
bundle
.
load
(
key
.
name
).
then
<
Null
>((
ByteData
data
)
{
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
final
TestByteData
testData
=
data
;
final
TestByteData
testData
=
data
;
final
ui
.
Image
image
=
new
TestImage
(
testData
.
scale
);
final
ui
.
Image
image
=
new
TestImage
(
testData
.
scale
);
imageInfo
=
new
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
imageInfo
=
new
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
...
...
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