i try to create a snackbar on scaffold, but error was Scaffold.of() called with a context that does not contain a Scaffold. and i can't solve it,i try to put a key but there is an error on it and can't setup an key, this is my code:
class Login extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
backgroundColor: Colors.transparent,
elevation: 0.0,
title: Text('Log in',
style: TextStyle(color: Colors.black),
textAlign: TextAlign.center),
),
SizedBox(
width: 500,
height: 50.0,
child: RaisedButton(
textColor: Colors.white,
color: Colors.blue,
child: Text('Log In'),
onPressed: () => {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Done!'),))
}))
])
],
),
),
),
));
}
}