Skip to content

onWillPop is not working properly #308

Description

@ZuniShahid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions