So I have a main screen that I want to display straight away to an old user of the app (Meaning token has been set) but to a new user, I want to display a column with some information etc. first and after the user presses the button it will open the main screen. However, the below code doesn't work as I wish (this doesn't change the view in any way). What would be the correct approach to this problem?

@override
  Widget build(BuildContext context) {
    return FutureBuilder<bool>(
      future: getPrefs(),
        builder: (context, AsyncSnapshot<bool> snapshot) {
          if (snapshot.hasData) {
            if(token == null){
              return Column(
                verticalDirection: VerticalDirection.up,
                children: [
                  ElevatedButton(
                    onPressed: (){
                      return mainScreen();
                    },
                  ),
                ],
              );

            }
            else{
              return mainScreen();
            }

          } else {
            return CircularProgressIndicator();
          }
        }
    );

  Widget mainScreen(){
    return Scaffold(
      appBar: AppBar(
        title: Text('Feed planner',
          style: TextStyle(fontSize: 17),
        ),
        toolbarHeight: 50,
        actions: [

          IconButton(icon: icon, onPressed: _pushSettings),
        ],
      ),

      body: Center(
        child: Column(
          children: [
            Expanded(child: _buildGrid()),
          ]
        )
      )
    );
  }


Solution 1: Huthaifa Muayyad

Edit 1, after OP provided more info:

Make your homescreen widget like this:

Widget mainScreen(bool token){
    return Scaffold(
      appBar: AppBar(
        title: Text('Feed planner',
          style: TextStyle(fontSize: 17),
        ),
        toolbarHeight: 50,
        actions: [

          IconButton(icon: icon, onPressed: _pushSettings),
        ],
      ),

      body: Center(
        child: Column(
          children: [
            token == null ? Text('Add your text or widget here for new users') : Container()
            Expanded(child: _buildGrid()),
          ]
        )
      )
    );
  }

And your Future builder like this:

FutureBuilder<bool>(
      future: getPrefs(),
        builder: (context, AsyncSnapshot<bool> snapshot) {
          if (snapshot.hasData) {
           return mainScreen(snapshot); //or the token you are getting
            }
           else {
            return CircularProgressIndicator();
          }
        })

The problem is here:

ElevatedButton(
 onPressed: (){
  return mainScreen();
 },
)

You should use:

ElevatedButton(
 onPressed: (){
  Navigator.pushNamed(context, '/mainScreen'); //or whatever the name of your home screen is in routes.
 },
)