Trying to figure out this flutter problem. The below code has the showSnackbar as deprecated, and am trying to figure out with the fix is. The second code is my attempt to fix the problem. A new problem comes up with "The getter 'ScaffoldMessenger' isn't defined for the type 'ScaffoldState'.". The error tells me to import material.dart file but it is already imported.
Any help is appreciated.
Padding(
padding: const EdgeInsets.all(10.0),
child: GestureDetector(
onTap: ()async{
if(!await authProvider.signIn()){
_key.currentState.showSnackBar(
SnackBar(content: Text("Login failed"))
);
}
},
Padding(
padding: const EdgeInsets.all(10.0),
child: GestureDetector(
onTap: ()async{
if(!await authProvider.signIn()){
_key.currentState.ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Login failed"))
);
}
},