Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace onPopPage with onDidRemovePage in Navigator #125

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
flutter_version: 3.19.5
flutter_version: 3.24.0

pana:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml
include: package:very_good_analysis/analysis_options.6.0.0.yaml
2 changes: 1 addition & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml
include: package:very_good_analysis/analysis_options.6.0.0.yaml
linter:
rules:
public_member_api_docs: false
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"

dependencies:
bloc: ^8.0.0
Expand All @@ -16,7 +16,7 @@ dependencies:
flutter_bloc: ^8.0.0

dev_dependencies:
very_good_analysis: ^5.1.0
very_good_analysis: ^6.0.0

flutter:
uses-material-design: true
5 changes: 2 additions & 3 deletions lib/flow_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class _FlowBuilderState<T> extends State<FlowBuilder<T>> {
pages: _pages,
observers: widget.observers,
clipBehavior: widget.clipBehavior,
onPopPage: (route, dynamic result) {
onDidRemovePage: (page) {
if (_history.length > 1) {
_history.removeLast();
_didPop = true;
Expand All @@ -194,8 +194,7 @@ class _FlowBuilderState<T> extends State<FlowBuilder<T>> {
_pages.removeLast();
}
setState(() {});
route.onPopInvoked(true);
return route.didPop(result);
page.onPopInvoked(true, null);
},
),
),
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ funding: [https://github.com/sponsors/felangel]
version: 0.1.0

environment:
sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"

dependencies:
flutter:
Expand All @@ -18,4 +18,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^5.1.0
very_good_analysis: ^6.0.0
6 changes: 2 additions & 4 deletions test/flow_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ void main() {
child: Builder(
builder: (context) => PopScope(
canPop: false,
onPopInvoked: (_) => onPopCallCount++,
onPopInvokedWithResult: (_, __) => onPopCallCount++,
child: TextButton(
key: targetKey,
onPressed: () {
Expand Down Expand Up @@ -1440,9 +1440,7 @@ void main() {
MaterialPage<void>(
child: Builder(
builder: (context) => PopScope(
onPopInvoked: (_) {
onPopCallCount++;
},
onPopInvokedWithResult: (_, __) => onPopCallCount++,
child: TextButton(
key: targetKey,
onPressed: () {
Expand Down