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