I am trying to show snackbar in my app to notify User but without scaffold it shows me error. My current code is:
scaffoldKey.currentState?.showSnackBar(
No, It is not possible. Snackbar is part of Scaffold. It must have a Scaffold parent. Snackbar
Inside Scaffold parent, you can do like below
BuildContext con=context; final snackBar = SnackBar(content: Text(message)); Scaffold.of(con).showSnackBar(snackBar);