I want to disable the android system Back Button but I cannot do it, I used WillPopScope, but I don`t know why is not working, can you help me? I put a part of the code
Thank you
Widget build(BuildContext context) {
CollectionReference users = FirebaseFirestore.instance.collection("users");
provider = Provider.of<CentralStoreScreenProvider>(context);
return WillPopScope(
onWillPop: () async {
return false;
},
child:
Scaffold(
appBar: searchBar!.build(context),
drawer: /**/
body: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: initialLocation,
markers: Set.of((marker != null) ? [marker!] : []),
circles: Set.of((circle != null) ? [circle!] : []),
onMapCreated: (GoogleMapController controller) {
_controller = controller;
},
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.location_searching),
onPressed: () {
getCurrentLocation();
}),
)
);
}