ProImageEditor.memory constructor

ProImageEditor.memory(
  1. Uint8List byteArray, {
  2. Key? key,
  3. required ProImageEditorCallbacks callbacks,
  4. ProImageEditorConfigs configs = const ProImageEditorConfigs(),
})

This constructor creates a ProImageEditor widget configured to edit an image loaded from the specified byteArray.

The byteArray parameter should contain the image data as a Uint8List.

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.ProImageEditor.memory(
  bytes,
  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.memory(
  Uint8List byteArray, {
  Key? key,
  required ProImageEditorCallbacks callbacks,
  ProImageEditorConfigs configs = const ProImageEditorConfigs(),
}) {
  return ProImageEditor._(
    key: key,
    byteArray: byteArray,
    configs: configs,
    callbacks: callbacks,
  );
}