mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
This reverts commit 6c7c2e372a
.
This commit is contained in:
parent
6c7c2e372a
commit
6563b0de34
@ -70,7 +70,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isInstanceOf<TypeError>()));
|
expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isCastError));
|
||||||
expect(await channel.invokeListMethod<String>('sayHello', 'hello'), <String>['hello', 'world']);
|
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(isInstanceOf<TypeError>()));
|
expect(channel.invokeMethod<Map<String, String>>('sayHello', 'hello'), throwsA(isCastError));
|
||||||
expect(await channel.invokeMapMethod<String, String>('sayHello', 'hello'), <String, String>{'hello': 'world'});
|
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) {
|
List<Map<String, dynamic>> _getList(dynamic object, String errorMessage) {
|
||||||
try {
|
try {
|
||||||
return (object as List<dynamic>).cast<Map<String, dynamic>>();
|
return (object as List<dynamic>).cast<Map<String, dynamic>>();
|
||||||
} on TypeError catch (_) {
|
} on CastError catch (_) {
|
||||||
throw IconTreeShakerException._(errorMessage);
|
throw IconTreeShakerException._(errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user