ProImageEditor.network constructor
ProImageEditor.network(
- String networkUrl, {
- Key? key,
- ProImageEditorConfigs configs = const ProImageEditorConfigs(),
- required ProImageEditorCallbacks callbacks,
This constructor creates a ProImageEditor
widget configured to edit an image loaded from the specified networkUrl
.
The networkUrl
parameter specifies the URL from which the image will be loaded.
The key
parameter is an optional parameter used to provide a Key
to the widget for identification and state preservation.
The configs
parameter specifies the configuration options for the image editor. It defaults to an empty instance of ProImageEditorConfigs
.
The callbacks
parameter is required and specifies the callbacks to handle events and interactions within the image editor.
Example usage:
ProImageEditor.network(
'https://example.com/image.jpg',
configs: ProImageEditorConfigs(),
callbacks: ProImageEditorCallbacks(
onImageEditingComplete: (Uint8List bytes) async {
/*
`Your code to handle the edited image. Upload it to your server as an example.
You can choose to use await, so that the load dialog remains visible until your code is ready,
or no async, so that the load dialog closes immediately.
*/
Navigator.pop(context);
},
),
)
Implementation
factory ProImageEditor.network(
String networkUrl, {
Key? key,
ProImageEditorConfigs configs = const ProImageEditorConfigs(),
required ProImageEditorCallbacks callbacks,
}) {
return ProImageEditor._(
key: key,
networkUrl: networkUrl,
configs: configs,
callbacks: callbacks,
);
}