closeEndDrawer method
void
closeEndDrawer()
Safely closes the end drawer using scaffoldKey or context
Implementation
void closeEndDrawer() {
final scaffoldKey = pupauConfig?.drawerConfig?.scaffoldKey;
if (scaffoldKey?.currentState != null) {
scaffoldKey!.currentState!.closeEndDrawer();
return;
}
// Fallback to using scaffold context if scaffoldKey is not available
BuildContext? context = scaffoldContext;
if (context != null) {
final scaffoldState = Scaffold.maybeOf(context);
if (scaffoldState != null) {
scaffoldState.closeEndDrawer();
}
}
}