bindMainScaffoldKey method

void bindMainScaffoldKey(
  1. GlobalKey<ScaffoldState> scaffoldKey
)

Explicitly binds the ScaffoldState used by main drawer helpers.

Main-stack drawer helpers auto-bind to the current page when possible. Use this method only when you want to override that behavior.

Implementation

void bindMainScaffoldKey(GlobalKey<ScaffoldState> scaffoldKey) {
  if (isMainStack) {
    _mainScaffoldKey = scaffoldKey;
  } else {
    debugPrint(
        'Warning: bindMainScaffoldKey() should only be called on main stack');
  }
}