Closed thanglq1 closed 2 months ago
4.2.1
3.22.2
Android, iOS
Hi @hm21. I'm trying customcloseWarningDialog but it throw error. You can see the log and the video below.
closeWarningDialog
https://github.com/hm21/pro_image_editor/assets/26729342/17729809-86e2-4f40-a591-8072e131966b
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4817 pos 12: '!_debugLocked': is not true. #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) #2 NavigatorState._pushEntry (package:flutter/src/widgets/navigator.dart:4817:12) #3 NavigatorState.push (package:flutter/src/widgets/navigator.dart:4774:5) #4 showDialog (package:flutter/src/material/dialog.dart:1436:65) #5 _CustomAppbarBottombarExampleState._buildEditor.<anonymous closure>.<anonymous closure> (package:example/pages/custom_appbar_bottombar_example.dart:149:30) #6 ProImageEditorState.closeWarning (package:pro_image_editor/modules/main_editor/main_editor.dart:1525:65) #7 ProImageEditorState.build.<anonymous closure> (package:pro_image_editor/modules/main_editor/main_editor.dart:1705:13) #8 ModalRoute.onPopInvoked (packa<…>
closeWarningDialog: (proImageEditorState) 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; },
No response
Can you try version 4.2.2, maybe that will fix it for you too.
4.2.2
Its working now. Thank you for quick fix @hm21.
Package Version
4.2.1
Flutter Version
3.22.2
Platforms
Android, iOS
How to reproduce?
Hi @hm21. I'm trying custom
closeWarningDialog
but it throw error. You can see the log and the video below.https://github.com/hm21/pro_image_editor/assets/26729342/17729809-86e2-4f40-a591-8072e131966b
Logs (optional)
Example code (optional)
Device Model (optional)
No response