closeDrawer method Null safety

void closeDrawer()

Closes Scaffold.drawer if it is currently opened.

See Scaffold.of for information about how to obtain the ScaffoldState.

Implementation

void closeDrawer() {
 if (hasDrawer && isDrawerOpen) {
   _drawerKey.currentState!.close();
 }
}