execute method

  1. @override
Future<bool?> execute(
  1. String caller,
  2. String propertyOrFunction,
  3. List arguments
)
override

Implementation

@override
Future<bool?> execute(
    String caller, String propertyOrFunction, List<dynamic> arguments) async {
  if (scope == null) return null;

  var function = propertyOrFunction.toLowerCase().trim();
  switch (function) {
    case "open":
      DrawerViewState? drawer =
          parent?.findListenerOfExactType(DrawerViewState);
      if (drawer != null) return await drawer.openDrawer(position);
      break;

    case "close":
      DrawerViewState? drawer =
          parent?.findListenerOfExactType(DrawerViewState);
      if (drawer != null) return await drawer.closeDrawer(position);
      break;
  }
  return super.execute(caller, propertyOrFunction, arguments);
}