skip to Main Content

I was writing a simple code but it gives an error.

this my code:

enter image description here

please help me guys 🙁

2

Answers


  1. The Text Button itself is designed correctly. I think the error might be that you gave Scaffold a const. Remove Const before Scaffold .

    Login or Signup to reply.
  2. remove const keyword before Scaffold

    return Scaffold(
          body: Center(
            child: TextButton(
              onPressed: () {
                Navigator.pop(context);
              },
              child: const Text("Go Back!"),
            ),
          ),
        );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search