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

onWillPop is not working properly #308

Open
ZuniShahid opened this issue Oct 1, 2022 · 3 comments · May be fixed by #309
Open

onWillPop is not working properly #308

ZuniShahid opened this issue Oct 1, 2022 · 3 comments · May be fixed by #309

Comments

@ZuniShahid
Copy link

I am using this in PersistentTabView :

onWillPop: (final context) async {
await showDialog(
context: context!,
useSafeArea: true,
builder: (final context) => Container(
height: 50,
width: 50,
color: Colors.white,
child: ElevatedButton(
child: const Text("Close"),
onPressed: () {
Navigator.pop(context);
},
),
),
);
return false;
},

I got this error message:
If you declare the onWillPop function, you will have to handle the back function functionality yourself as your onWillPop function will override the default function.
'package:persistent_bottom_nav_bar/persistent_tab_view.widget.dart':
Failed assertion: line 49 pos 16: 'handleAndroidBackButtonPress && onWillPop == null'

And also if we have to use onwillpop in different screen. How can we use.

@deremakif
Copy link

Same issue!

yu1ro added a commit to yu1ro/PersistentBottomNavBar that referenced this issue Oct 9, 2022
@yu1ro yu1ro linked a pull request Oct 9, 2022 that will close this issue
@Nedimko123
Copy link

same

1 similar comment
@NaarGes
Copy link

NaarGes commented Feb 13, 2023

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants