📅  最后修改于: 2022-03-11 14:48:08.255000             🧑  作者: Mango
// We can simply use the WidgetBinding instance to add a callback after the build method is called.. that will show the
// snackbar after the initState is completed and build method is called.
void initState() {
super.initState();
WidgetsBinding.instance
.addPostFrameCallback((_) => _scaffoldKey.currentState.showSnackBar(SnackBar(content: Text("Your message here..")));
}