Flutter: Looking up a deactivated widget's ancestor is unsafe on android backpress

554 views Asked by At

I have several pages in my app. Navigation is done as follows.

        Navigator.push(
         context,
        MaterialPageRoute(
          builder: (context) => ContactsPage(
              username: _username),
        ));

Then when I press the back button on android I see the following warning.

The following assertion was thrown while dispatching notifications for FocusManager:
Looking up a deactivated widget's ancestor is unsafe.

How do I get rid of this warning? The pages are not dialogs, they are stateful widgets.

0

There are 0 answers