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

This commit is contained in:
Michael Goderbauer 2017-02-01 16:33:27 -08:00 committed by GitHub
parent 50125ab271
commit 40aab7f553
9 changed files with 17 additions and 15 deletions

View file

@ -1 +1 @@
1.22.0-dev.9.1 1.22.0-dev.10.3

View file

@ -76,7 +76,7 @@ class StockDataFetcher {
String json = response.body; String json = response.body;
if (json == null) { if (json == null) {
print("Failed to load stock data chunk ${_nextChunk - 1}"); print("Failed to load stock data chunk ${_nextChunk - 1}");
return; return null;
} }
JsonDecoder decoder = new JsonDecoder(); JsonDecoder decoder = new JsonDecoder();
callback(new StockData(decoder.convert(json))); callback(new StockData(decoder.convert(json)));

View file

@ -517,7 +517,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> {
style: _textStyle, style: _textStyle,
)).then<Null>((_DropdownRouteResult<T> newValue) { )).then<Null>((_DropdownRouteResult<T> newValue) {
if (!mounted || newValue == null) if (!mounted || newValue == null)
return; return null;
if (config.onChanged != null) if (config.onChanged != null)
config.onChanged(newValue.result); config.onChanged(newValue.result);
}); });

View file

@ -537,7 +537,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
) )
.then<Null>((T newValue) { .then<Null>((T newValue) {
if (!mounted || newValue == null) if (!mounted || newValue == null)
return; return null;
if (config.onSelected != null) if (config.onSelected != null)
config.onSelected(newValue); config.onSelected(newValue);
}); });

View file

@ -317,14 +317,14 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
final double newScrollOffset = snapScrollOffset(scrollOffset + scrollVelocity.sign) final double newScrollOffset = snapScrollOffset(scrollOffset + scrollVelocity.sign)
.clamp(snapScrollOffset(scrollOffset - 0.5), snapScrollOffset(scrollOffset + 0.5)); .clamp(snapScrollOffset(scrollOffset - 0.5), snapScrollOffset(scrollOffset + 0.5));
return scrollTo(newScrollOffset, duration: config.duration, curve: config.curve) return scrollTo(newScrollOffset, duration: config.duration, curve: config.curve)
.then(_notifyPageChanged); .then<Null>(_notifyPageChanged);
} }
@override @override
Future<Null> fling(double scrollVelocity) { Future<Null> fling(double scrollVelocity) {
switch(config.itemsSnapAlignment) { switch(config.itemsSnapAlignment) {
case PageableListFlingBehavior.canFlingAcrossMultiplePages: case PageableListFlingBehavior.canFlingAcrossMultiplePages:
return super.fling(scrollVelocity).then(_notifyPageChanged); return (super.fling(scrollVelocity)).then<Null>(_notifyPageChanged);
case PageableListFlingBehavior.stopAtNextPage: case PageableListFlingBehavior.stopAtNextPage:
return _flingToAdjacentItem(scrollVelocity); return _flingToAdjacentItem(scrollVelocity);
} }
@ -335,7 +335,7 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
@override @override
Future<Null> settleScrollOffset() { Future<Null> settleScrollOffset() {
return scrollTo(snapScrollOffset(scrollOffset), duration: config.duration, curve: config.curve) return scrollTo(snapScrollOffset(scrollOffset), duration: config.duration, curve: config.curve)
.then(_notifyPageChanged); .then<Null>(_notifyPageChanged);
} }
void _notifyPageChanged(Null value) { void _notifyPageChanged(Null value) {

View file

@ -143,7 +143,7 @@ class WidgetController {
/// ///
/// * Use [firstState] if you expect to match several states but only want the first. /// * 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. /// * 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(); TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().single, finder); return _stateOf<T>(finder.evaluate().single, finder);
} }
@ -155,7 +155,7 @@ class WidgetController {
/// matching widget has no state. /// matching widget has no state.
/// ///
/// * Use [state] if you only expect to match one 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(); TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().first, finder); return _stateOf<T>(finder.evaluate().first, finder);
} }
@ -167,12 +167,12 @@ class WidgetController {
/// ///
/// * Use [state] if you only expect to match one state. /// * Use [state] if you only expect to match one state.
/// * Use [firstState] if you expect to match several but only want the first. /// * 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(); TestAsyncUtils.guardSync();
return finder.evaluate().map((Element element) => _stateOf<T>(element, finder)); 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(); TestAsyncUtils.guardSync();
if (element is StatefulElement) if (element is StatefulElement)
return element.state; return element.state;

View file

@ -102,8 +102,10 @@ class TestAsyncUtils {
throw new FlutterError(message.toString().trimRight()); throw new FlutterError(message.toString().trimRight());
} }
} }
return result.then( return result.then<Null>(
(Null value) => completionHandler(null, null), (Null value) {
completionHandler(null, null);
},
onError: completionHandler onError: completionHandler
); );
} }

View file

@ -464,7 +464,7 @@ class AppDomain extends Domain {
if (app == null) if (app == null)
throw "app '$appId' not found"; 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; return true;
}).catchError((dynamic error) { }).catchError((dynamic error) {
_sendAppEvent(app, 'log', <String, dynamic>{ 'log': '$error', 'error': true }); _sendAppEvent(app, 'log', <String, dynamic>{ 'log': '$error', 'error': true });

View file

@ -278,7 +278,7 @@ class IOSDevice extends Device {
Future<int> launch = runCommandAndStreamOutput(launchCommand, trace: true); 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; installationResult = result;
if (result != 0) { if (result != 0) {