Answer the question
In order to leave comments, you need to log in
How to pass data to another window and forbid going back?
I have 2 windows. The first one is, for example, loginScreen() . In it, I want to go to the second mainScreen() window and pass data there:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MainScreen(token: "qwerty"),
)
);
AppBar(
automaticallyImplyLeading: false
)
Answer the question
In order to leave comments, you need to log in
use pushReplacement instead of push
then automaticallyImplyLeading: false is not needed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question