rootScaffoldMessengerKey property
Use this Key in the MaterialApp. This will automatically find ScaffoldMessenger in the nearest Scaffold.
Implementation
static final rootScaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
Use this Key in the MaterialApp. This will automatically find ScaffoldMessenger in the nearest Scaffold.
static final rootScaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();