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