call method

  1. @override
$Value? call(
  1. Runtime runtime,
  2. $Value? target,
  3. List<$Value?> args
)

Implementation

@override
$Value? call(Runtime runtime, $Value? target, List<$Value?> args) {
  final result = showAlertDialog(
    context: args[0]!.$value,
    title: args[1]?.$value,
    message: args[2]?.$value,
    actions: (args[3]?.$reified ?? const [] as List?)?.cast(),
    barrierDismissible: args[4]?.$value ?? true,
    style: args[5]?.$value,
    useActionSheetForCupertino: args[6]?.$value ?? false,
    useActionSheetForIOS: args[7]?.$value ?? false,
    useRootNavigator: args[8]?.$value ?? true,
    actionsOverflowDirection: args[9]?.$value ?? VerticalDirection.up,
    fullyCapitalizedForMaterial: args[10]?.$value ?? false,
    canPop: args[11]?.$value ?? true,
    onPopInvokedWithResult: (bool didPop, dynamic result) {
      (args[12]! as EvalCallable?)?.call(runtime, null, [
        $bool(didPop),
        if (result == null) const $null() else runtime.wrapAlways(result),
      ]);
    },
    builder: (BuildContext context, Widget child) {
      return (args[13]! as EvalCallable?)?.call(runtime, null, [
        $BuildContext.wrap(context),
        $Widget.wrap(child),
      ])?.$value;
    },
    macOSApplicationIcon: args[14]?.$value,
    routeSettings: args[15]?.$value,
  );
  return $Future.wrap(
    result.then((e) => e == null ? const $null() : runtime.wrapAlways(e)),
  );
}