editImage static method

Future<Uint8List?> editImage(
  1. File file
)

Implementation

static Future<Uint8List?> editImage(File file) async {
  Uint8List? imageBytes;
  BuildContext? safeContext = getSafeModalContext();
  if (safeContext == null) return null;
  await Navigator.push(
    safeContext,
    MaterialPageRoute(
      builder: (context) => ProImageEditor.file(
        file,
        configs: ProImageEditorConfigs(
          cropRotateEditor: CropRotateEditorConfigs(
            style: CropRotateEditorStyle(cropCornerColor: Colors.white),
          ),
        ),
        callbacks: ProImageEditorCallbacks(
          onImageEditingComplete: (Uint8List bytes) async {
            imageBytes = bytes;
            Navigator.pop(context);
          },
        ),
      ),
    ),
  );
  return imageBytes;
}