Skip to content

how to define context of navigator in the button,which is in the LandingPage.  #1

Description

@lotfikadd

hello @letsdoit07
thanks to share with us this tutorial , it was so helpful.
i want to routes the button which is in landingpage, to take me to other page ,
`

        Padding(
          padding: const EdgeInsets.symmetric(vertical: 30.0),
          child: Text(
            "Le meilleur endroit où vous pouvez........",
            style: GoogleFonts.questrial(
            fontSize: 20.0,color: Colors.grey),
          ),
        ),
         MaterialButton(
              color: Colors.blue[900],
                splashColor: Colors.blue[200],
                shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(30.0)),
              ),
              onPressed: (){
                Navigator.of(context).pushNamed('/logingpage');
              },
              child: Padding(
                padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 25.0),
                  child: Text(
                    "Log In",
                  style: GoogleFonts.questrial(
                  color: Colors.white,
                  fontSize: 25.0
                  ),
                ),
              ),
        ),

`
but the context claims that the context is undefined.
i appreciate it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions