BlurEditor.autoSource constructor
BlurEditor.autoSource({})
Constructs a BlurEditor
widget with an image loaded automatically based on the provided source.
Either byteArray
, file
, networkUrl
, or assetPath
must be provided.
Implementation
factory BlurEditor.autoSource({
Key? key,
required BlurEditorInitConfigs initConfigs,
Uint8List? byteArray,
File? file,
String? assetPath,
String? networkUrl,
}) {
if (byteArray != null) {
return BlurEditor.memory(
byteArray,
key: key,
initConfigs: initConfigs,
);
} else if (file != null) {
return BlurEditor.file(
file,
key: key,
initConfigs: initConfigs,
);
} else if (networkUrl != null) {
return BlurEditor.network(
networkUrl,
key: key,
initConfigs: initConfigs,
);
} else if (assetPath != null) {
return BlurEditor.asset(
assetPath,
key: key,
initConfigs: initConfigs,
);
} else {
throw ArgumentError(
"Either 'byteArray', 'file', 'networkUrl' or 'assetPath' must be provided.");
}
}