open method

void open([
  1. BuildContext? context
])

Implementation

void open([BuildContext? context]) {
  if (!isOpen) {
    isOpen = true;
    // Usually open only should set the isOpen variable, but if we have a
    // mobile sized device OR the fold policy is set to always, we open the
    // drawer because this is how the actual libadwaita behaves
    if (isModal || _policy == FoldPolicy.always) {
      switch (_position) {
        case FlapPosition.start:
          Scaffold.of(context ?? this.context!).openDrawer();
          break;
        case FlapPosition.end:
          Scaffold.of(context ?? this.context!).openEndDrawer();
          break;
      }
    }
    notifyListeners();
  }
}