Victor Garcia
Victor Garcia

Reputation: 155

Is it possible to be redirected to a specific page with that page's widget open?

I'm new to the flutter, and I have a question. When the user creates the account, I would like to redirect him to the configuration page with a certain Widget on the page already open. It's possible?

Navigator.push(context, MaterialPageRoute(builder: (context){
          return SettingsWidget();
})); 

I'm using this code to direct the Configuration page, but the Widget that has the person inside would have to click on the button, but I wanted it to be already open.

Upvotes: 0

Views: 176

Answers (1)

hewa jalal
hewa jalal

Reputation: 963

I think you want to show a dialog as soon as the page opens! If that is your requirement you can do this:

@override
  void initState() {
    super.initState();
    SchedulerBinding.instance
        .addPostFrameCallback((_) => showDialog(context));
    
  }

Upvotes: 1

Related Questions