closeWarningDialog property
Override the close warning dialog when we made changes.
Example:
configs: ProImageEditorConfigs(
customWidgets: ImageEditorCustomWidgets(
closeWarningDialog: () async {
return await showDialog<bool>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Close?'),
content: const Text('Are you sure you want to close the Image Editor? Your changes will not be saved.'),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, false),
child: const Text('Cancel'),
),
TextButton(
onPressed: () => Navigator.pop(context, true),
child: const Text('OK'),
),
],
),
) ??
false;
},
),
),
Implementation
final Future<bool> Function()? closeWarningDialog;