I want to Open Drawer in flutter and used Scaffold key and was working before but after the flutter upgrade, I am getting this error:
An expression whose value can be 'null' must be null-checked before it can be dereferenced.
Try checking that the value isn't 'null' before dereferencing it.
My code goes like this:
I declared a Global Scaffold key GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey();
then called it by flat button
FlatButton.icon(
label: Text("filter",style: style2.copyWith(color:Colors.lightGreenAccent[400],fontWeight: FontWeight.bold),),
onPressed: (){
_scaffoldKey.currentState.openEndDrawer();
},
),
