mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
This commit is contained in:
parent
9ccac00599
commit
31175eb008
|
@ -70,7 +70,7 @@ void main() {
|
|||
}
|
||||
},
|
||||
);
|
||||
expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isCastError));
|
||||
expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isInstanceOf<TypeError>()));
|
||||
expect(await channel.invokeListMethod<String>('sayHello', 'hello'), <String>['hello', 'world']);
|
||||
});
|
||||
|
||||
|
@ -102,7 +102,7 @@ void main() {
|
|||
}
|
||||
},
|
||||
);
|
||||
expect(channel.invokeMethod<Map<String, String>>('sayHello', 'hello'), throwsA(isCastError));
|
||||
expect(channel.invokeMethod<Map<String, String>>('sayHello', 'hello'), throwsA(isInstanceOf<TypeError>()));
|
||||
expect(await channel.invokeMapMethod<String, String>('sayHello', 'hello'), <String, String>{'hello': 'world'});
|
||||
});
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const bool kIconTreeShakerEnabledDefault = false;
|
|||
List<Map<String, dynamic>> _getList(dynamic object, String errorMessage) {
|
||||
try {
|
||||
return (object as List<dynamic>).cast<Map<String, dynamic>>();
|
||||
} on CastError catch (_) {
|
||||
} on TypeError catch (_) {
|
||||
throw IconTreeShakerException._(errorMessage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue