title: Dart / Flutter: Navigate (with Navigator) between Pages without context (so no Navigator.push?)
body: <p>In my App I have 6 different pages.
  Theres 1 page called &quot;FavouritesPage&quot;, where user pickes favourites are listed. They are displayed by a column, which uses a list from another class. The code of the list is following:</p>
  <pre><code>  List&lt;Widget&gt; favoriteContainerLists() {
      DatabaseProvider.db.queryDb();
      List&lt;Widget&gt; localList = [];
      if (DatabaseProvider.publicFavoriteList == null ||
          DatabaseProvider.publicFavoriteList.isEmpty) {
        localList.add(
          Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Text(
                &quot;Hier erscheinen deine Favoriten!&quot;,
                style: TextStyle(
                  fontFamily: &quot;Hind&quot;,
                  fontSize: 22,
                ),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    &quot;Makiere Bilder auf der Informationsseite mit &quot;,
                    style: TextStyle(
                      color: Colors.indigo,
                      fontFamily: &quot;Hind&quot;,
                      fontSize: 15,
                    ),
                  ),
                  Icon(
                    Icons.star_border,
                    color: Colors.orange,
                  ),
                ],
              ),
              Text(
                &quot; um sie hinzuzufügen!&quot;,
                style: TextStyle(
                  color: Colors.indigo,
                  fontFamily: &quot;Hind&quot;,
                  fontSize: 15,
                ),
              ),
            ],
          ),
        );
      } else {
        localList.add(Padding(
          padding: const EdgeInsets.only(bottom: 15.0),
          child: Text(
            &quot;Deine Favoriten:&quot;,
            textAlign: TextAlign.left,
            style: TextStyle(
              fontSize: 30,
              color: Colors.indigoAccent,
              fontFamily: &quot;Hind&quot;,
            ),
          ),
        ));
        for (var i = 0; i &lt; DatabaseProvider.publicFavoriteList.length; i++) {
          DatabaseProvider.db.queryDb();
          int currentIdInt = DatabaseProvider.publicFavoriteList[i];
          localList.add(
            Padding(
              padding: const EdgeInsets.only(bottom: 15),
              child: MaterialButton(
                onPressed: ***null***,
                padding: const EdgeInsets.only(bottom: 0),
                child: Container(
                  width: double.infinity,
                  height: 120,
                  decoration: BoxDecoration(
                    color: buttonColor,
                    borderRadius: BorderRadius.only(
                        topLeft: Radius.circular(8),
                        topRight: Radius.circular(8),
                        bottomLeft: Radius.circular(8),
                        bottomRight: Radius.circular(8)),
                    boxShadow: [
                      BoxShadow(
                        color: Colors.grey.withOpacity(0.5),
                        spreadRadius: 5,
                        blurRadius: 7,
                        offset: Offset(0, 3), // changes position of shadow
                      ),
                    ],
                  ),
                  child: Padding(
                    padding: const EdgeInsets.fromLTRB(10, 8, 10, 8),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Center(
                          child: Container(
                            width: 70,
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.only(
                                  topLeft: Radius.circular(8),
                                  topRight: Radius.circular(8),
                                  bottomLeft: Radius.circular(8),
                                  bottomRight: Radius.circular(8)),
                            ),
                            child: Image.asset(
                                AppBrain().contentList[currentIdInt].imageAdress),
                          ),
                        ),
                        VerticalDivider(
                          thickness: 2,
                          indent: 15,
                          endIndent: 15,
                        ),
                        Expanded(
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.start,
                            children: [
                              Text(
                                AppBrain().contentList[currentIdInt].artName,
                                style: TextStyle(
                                    fontFamily: &quot;Hind&quot;,
                                    fontSize: 23,
                                    color: Colors.blueGrey),
                              ),
                              Expanded(
                                child: Container(
                                  child: RichText(
                                    maxLines: 2,
                                    softWrap: true,
                                    overflow: TextOverflow.ellipsis,
                                    textAlign: TextAlign.left,
                                    text: TextSpan(
                                      style: TextStyle(
                                          fontSize: 14,
                                          color: Colors.black,
                                          fontFamily: &quot;Hind&quot;),
                                      text:
                                          (contentList[currentIdInt].description),
                                    ),
                                  ),
                                ),
                              )
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ),
          );
        }
      }
      return localList;
    }
  </code></pre>
  <p>The code of the page displaying it:</p>
  <pre><code>  Widget build(BuildContext context) {
      DatabaseProvider.db.queryDb();
      return SafeArea(
        child: Scaffold(
          backgroundColor: Colors.white,
          bottomNavigationBar: BottomNavigationBar(
            items: [
              BottomNavigationBarItem(
                  icon: Icon(Icons.home), title: Text(&quot;Startseite&quot;)),
              BottomNavigationBarItem(
                  icon: Icon(Icons.star), title: Text(&quot;Favoriten&quot;)),
              BottomNavigationBarItem(
                  icon: Icon(Icons.casino), title: Text(&quot;Quiz&quot;)),
              BottomNavigationBarItem(
                  icon: Icon(Icons.map), title: Text(&quot;Karte&quot;)),
            ],
            type: BottomNavigationBarType.fixed,
            unselectedItemColor: Colors.grey,
            showUnselectedLabels: true,
            currentIndex: _selectedIndex,
            selectedItemColor: Colors.blue,
            onTap: _onItemTapped,
          ),
          body: SingleChildScrollView(
            child: WillPopScope(
              onWillPop: _backButtonPressed,
              child: Padding(
                padding: const EdgeInsets.only(left: 15, right: 15, top: 8),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: AppBrain().favoriteContainerLists(),
                ),
              ),
            ),
          ),
        ),
      );
    }
  </code></pre>
  <p>They are located in 2 different classes. The class containing the list doesn't have a BuildContext and also should have non. Ideally, where it says <code>onTap: null,</code>  at the moment I want it to be</p>
  <pre><code>Navigator.of(context).push(
       toInformationPage(),
                            ); 
  </code></pre>
  <p>but I know I can't use anything that requires context. Any Ideas?</p>