Commit a5b31391 authored by Vyacheslav Egorov's avatar Vyacheslav Egorov Committed by Siva

Use void as type argument instead of Null where appropriate

parent 84580b54
...@@ -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;
} }
} }
......
...@@ -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
......
...@@ -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: () {
......
...@@ -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
......
...@@ -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
......
...@@ -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();
} }
} }
......
...@@ -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;
......
...@@ -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.
}); });
......
...@@ -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)
......
...@@ -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(() {
......
...@@ -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);
......
...@@ -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(
......
...@@ -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,
......
...@@ -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,
......
...@@ -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) {
......
...@@ -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
......
...@@ -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);
......
...@@ -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,
......
...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment