call method

  1. @override
Object call(
  1. Interpreter interpreter,
  2. List<Object?> arguments,
  3. Map<Symbol, Object?> namedArguments
)
override

Implementation

@override
Object call(Interpreter interpreter, List<Object?> arguments,
    Map<Symbol, Object?> namedArguments) {
  var context = namedArguments[const Symbol('context')];
  if (context == null) {
    throw "context required in showDialog";
  }
  bool barrierDismissible = true;
  var barrierDismissibleParsed =
      namedArguments[const Symbol('barrierDismissible')];
  if (barrierDismissibleParsed != null) {
    barrierDismissible = barrierDismissibleParsed as bool;
  }
  Color? barrierColor = Colors.black54;
  var barrierColorParsed = namedArguments[const Symbol('barrierColor')];
  if (barrierColorParsed != null) {
    barrierColor = barrierColorParsed as Color;
  }
  var builder = namedArguments[const Symbol('builder')];
  if (builder == null) {
    throw "builder required in showDialog";
  }
  bool useSafeArea = true;
  var useSafeAreaParsed = namedArguments[const Symbol('useSafeArea')];
  if (useSafeAreaParsed != null) {
    useSafeArea = useSafeAreaParsed as bool;
  }
  bool useRootNavigator = true;
  var useRootNavigatorParsed =
      namedArguments[const Symbol('useRootNavigator')];
  if (useRootNavigatorParsed != null) {
    useRootNavigator = useRootNavigatorParsed as bool;
  }
  return showDialog(
      context: context as BuildContext,
      barrierDismissible: barrierDismissible,
      barrierColor: barrierColor,
      useSafeArea: useSafeArea,
      useRootNavigator: useRootNavigator,
      builder: (ctx) {
        return (builder as LoxFunction).call(interpreter, [ctx], {})
            as Widget;
      });
}