Closed adamkoch closed 3 months ago
Yes, it's not possible because the editor also has to call Navigator.pop(context)
internally to close the “loading-dialog”, so you never get any data back, which is why there are so many callbacks.
However, if you want to handle the bytes outside the callback, you can do it like this:
Uint8List? result;
await Navigator.push(
context,
MaterialPageRoute(
builder: (_) => ProImageEditor.network(
url,
callbacks:
ProImageEditorCallbacks(onImageEditingComplete: (bytes) async {
result = bytes;
}),
),
fullscreenDialog: true,
),
);
log('result = ${result?.length}');
Ahh thanks! I thought I was doing something wrong in my code. Will give your workaround a go, thanks 👍
Package Version
3.0.4
Flutter Version
3.22.2
Platforms
Android, iOS
How to reproduce?
Not sure if I'm doing something wrong, but I can't seem to get Navigator.pop() to return the value back to the screen that called Navigator.push().
Here is a simple example that doesn't work for me, returning a string instead of the bytes. The final log always has result=null.
Any ideas?
Logs (optional)
No response
Example code (optional)
No response
Device Model (optional)
No response