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

@@ -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;

View File

@@ -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
);
}