I have no clue why this is happening. When device or emulator back button is pressed, nothing happens. App bar back button is working!, implemented back button works also.
I've created a new flutter project to test this problem:
First page
Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: FlatButton(
color: Colors.grey[300],
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NextPage(),
),
);
},
child: Text('next page'),
),
),
);
Second page
Scaffold(
appBar: AppBar(
title: Text('next page'),
),
body: Center(
child: FlatButton(
color: Colors.grey[300],
onPressed: () {
Navigator.pop(context);
},
child: Text('go back'),
),
),
);