load static method
Future<Uint8List?>
load(
- NativeImageType type,
- String name, {
- double? width,
- double? height,
- double? scale,
- Brightness? brightness,
Loads an image of type named name. name is ignored for
NativeImageType.appIcon.
Implementation
static Future<Uint8List?> load(
NativeImageType type,
String name, {
double? width,
double? height,
double? scale,
Brightness? brightness,
}) async {
try {
return await _channel.invokeMethod<Uint8List>("load", {
"type": type.name,
"name": name,
"width": width,
"height": height,
"scale": scale ?? _deviceScale,
if (brightness != null) "dark": brightness == Brightness.dark,
});
} on PlatformException catch (error) {
if (error.code == "NOT_FOUND") return null;
rethrow;
}
}