From 117a14d724fc938aaffe5cc247855b562c09a3b7 Mon Sep 17 00:00:00 2001 From: Oleksii Furaiev Date: Fri, 12 Apr 2024 00:15:42 +0300 Subject: [PATCH] fix: SystemNavigator.pop respects PopScope(canPop: true) --- CHANGELOG.md | 4 ++++ lib/flow_builder.dart | 7 ++++++- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf48b9..b5fd2fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.1 + +- fix: SystemNavigator.pop respects PopScope(canPop: true) + # 0.1.0 - **BREAKING**: replace deprecated `WillPopScope` with `PopScope` diff --git a/lib/flow_builder.dart b/lib/flow_builder.dart index c79a6ec..d6438d1 100644 --- a/lib/flow_builder.dart +++ b/lib/flow_builder.dart @@ -149,7 +149,12 @@ class _FlowBuilderState extends State> { if (mounted) { final popHandled = await _navigator?.maybePop() ?? false; if (popHandled) return true; - if (mounted && !_canPop) _navigator?.pop(); + if (mounted && !_canPop) { + // call onPopInvoked if any + _navigator?.pop(); + // really navigate + return Navigator.of(context).maybePop(); + } return false; } return false; diff --git a/pubspec.yaml b/pubspec.yaml index 489a23f..5750b62 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/felangel/flow_builder homepage: https://github.com/felangel/flow_builder topics: [navigation, routing] -version: 0.1.0 +version: 0.1.1 environment: sdk: ">=3.2.0 <4.0.0"