Commit 40aab7f5 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Bump Dart SDK to 1.22.0-dev.10.3 (#7791)

parent 50125ab2
......@@ -76,7 +76,7 @@ class StockDataFetcher {
String json = response.body;
if (json == null) {
print("Failed to load stock data chunk ${_nextChunk - 1}");
return;
return null;
}
JsonDecoder decoder = new JsonDecoder();
callback(new StockData(decoder.convert(json)));
......
......@@ -517,7 +517,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> {
style: _textStyle,
)).then<Null>((_DropdownRouteResult<T> newValue) {
if (!mounted || newValue == null)
return;
return null;
if (config.onChanged != null)
config.onChanged(newValue.result);
});
......
......@@ -537,7 +537,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
)
.then<Null>((T newValue) {
if (!mounted || newValue == null)
return;
return null;
if (config.onSelected != null)
config.onSelected(newValue);
});
......
......@@ -317,14 +317,14 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
final double newScrollOffset = snapScrollOffset(scrollOffset + scrollVelocity.sign)
.clamp(snapScrollOffset(scrollOffset - 0.5), snapScrollOffset(scrollOffset + 0.5));
return scrollTo(newScrollOffset, duration: config.duration, curve: config.curve)
.then(_notifyPageChanged);
.then<Null>(_notifyPageChanged);
}
@override
Future<Null> fling(double scrollVelocity) {
switch(config.itemsSnapAlignment) {
case PageableListFlingBehavior.canFlingAcrossMultiplePages:
return super.fling(scrollVelocity).then(_notifyPageChanged);
return (super.fling(scrollVelocity)).then<Null>(_notifyPageChanged);
case PageableListFlingBehavior.stopAtNextPage:
return _flingToAdjacentItem(scrollVelocity);
}
......@@ -335,7 +335,7 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
@override
Future<Null> settleScrollOffset() {
return scrollTo(snapScrollOffset(scrollOffset), duration: config.duration, curve: config.curve)
.then(_notifyPageChanged);
.then<Null>(_notifyPageChanged);
}
void _notifyPageChanged(Null value) {
......
......@@ -143,7 +143,7 @@ class WidgetController {
///
/// * Use [firstState] if you expect to match several states but only want the first.
/// * Use [stateList] if you expect to match several states and want all of them.
T state<T extends State>(Finder finder) {
T state<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed
TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().single, finder);
}
......@@ -155,7 +155,7 @@ class WidgetController {
/// matching widget has no state.
///
/// * Use [state] if you only expect to match one state.
T firstState<T extends State>(Finder finder) {
T firstState<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed
TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().first, finder);
}
......@@ -167,12 +167,12 @@ class WidgetController {
///
/// * Use [state] if you only expect to match one state.
/// * Use [firstState] if you expect to match several but only want the first.
Iterable<T> stateList<T extends State>(Finder finder) {
Iterable<T> stateList<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed
TestAsyncUtils.guardSync();
return finder.evaluate().map((Element element) => _stateOf<T>(element, finder));
}
T _stateOf<T extends State>(Element element, Finder finder) {
T _stateOf<T extends State<StatefulWidget>>(Element element, Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed
TestAsyncUtils.guardSync();
if (element is StatefulElement)
return element.state;
......
......@@ -102,8 +102,10 @@ class TestAsyncUtils {
throw new FlutterError(message.toString().trimRight());
}
}
return result.then(
(Null value) => completionHandler(null, null),
return result.then<Null>(
(Null value) {
completionHandler(null, null);
},
onError: completionHandler
);
}
......
......@@ -464,7 +464,7 @@ class AppDomain extends Domain {
if (app == null)
throw "app '$appId' not found";
return app.stop().timeout(new Duration(seconds: 5)).then((_) {
return app.stop().timeout(new Duration(seconds: 5)).then<bool>((_) {
return true;
}).catchError((dynamic error) {
_sendAppEvent(app, 'log', <String, dynamic>{ 'log': '$error', 'error': true });
......
......@@ -278,7 +278,7 @@ class IOSDevice extends Device {
Future<int> launch = runCommandAndStreamOutput(launchCommand, trace: true);
List<Uri> uris = await launch.then((int result) async {
List<Uri> uris = await launch.then<List<Uri>>((int result) async {
installationResult = result;
if (result != 0) {
......
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