-
Notifications
You must be signed in to change notification settings - Fork 96
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
Remove WillPopScope #431
Remove WillPopScope #431
Conversation
Thanks @remonke |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #431 +/- ##
==========================================
- Coverage 95.58% 95.57% -0.01%
==========================================
Files 66 66
Lines 1359 1356 -3
==========================================
- Hits 1299 1296 -3
Misses 60 60 ☔ View full report in Codecov by Sentry. |
@remonke could you clarify why you removed the it completely instead of migration to |
Here's an example of how this could be implemented: class ReactiveFormPopScope extends StatelessWidget {
final bool Function(FormGroup formGroup)? canPop;
final bool Function(bool didPop, FormGroup formGroup)? onPopInvoked;
final Widget child;
const ReactiveFormPopScope({
super.key,
this.canPop,
this.onPopInvoked,
required this.child,
});
@override
Widget build(BuildContext context) {
return ReactiveFormConsumer(
builder: (context, formGroup, _) {
return PopScope(
canPop: canPop != null ? canPop!(formGroup) : true,
onPopInvoked: onPopInvoked != null
? (didPop) => onPopInvoked!(didPop, formGroup)
: null,
child: child,
);
},
);
}
} |
I decided to implement |
canPop: canPop, | ||
onPopInvoked: onPopInvoked, | ||
child: child, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @remonke.
Why create a new widget instead of using directly the PopScope
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way they do it in the Flutter Form
widget, just decided to copy this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also improve performance I guess, since each form change would cause the widget to get rebuild.
Hi @remonke I like the idea of this PR but before I can approve it there are some issues I believe should be addressed first: 1- Some tests are failing with this PR. The tests should be adapted and new tests should be implemented if necessary. Thanks a lot for the great work. |
I updated the CHANGELOG.md and pubspec.yaml, but I tried running |
Hi @remonke, Oh I know what is happening we need to update the Flutter version used in the build CI |
Right now @remonke the CI is using the Flutter 3.10.0 to build the project, but we need to update it to the minimum Flutter version that introduces the |
BTW in this PR you should update the |
Sorry, I'm not familiar with CI/CD. Any reason you can't fix it yourself? |
Add Flutter 3.16.0 to cli
Fix #430