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 = showConfirmationDialog(
    context: args[0]!.$value as BuildContext,
    title: args[1]!.$value,
    message: args[2]?.$value,
    okLabel: args[3]?.$value,
    cancelLabel: args[4]?.$value,
    contentMaxHeight: args[5]?.$value,
    actions: (args[6]?.$reified ?? const [] as List?)?.cast(),
    initialSelectedActionKey: args[7]?.$value,
    barrierDismissible: args[8]?.$value ?? true,
    style: args[9]?.$value,
    useRootNavigator: args[10]?.$value ?? true,
    shrinkWrap: args[11]?.$value ?? true,
    fullyCapitalizedForMaterial: args[12]?.$value ?? false,
    canPop: args[13]?.$value ?? true,
    onPopInvokedWithResult: (bool didPop, dynamic result) {
      (args[14]! as EvalCallable?)?.call(runtime, null, [
        $bool(didPop),
        if (result == null) const $null() else runtime.wrapAlways(result),
      ]);
    },
    builder: (BuildContext context, Widget child) {
      return (args[15]! as EvalCallable?)?.call(runtime, null, [
        $BuildContext.wrap(context),
        $Widget.wrap(child),
      ])?.$value;
    },
    routeSettings: args[16]?.$value,
    toggleable: args[17]?.$value ?? true,
  );
  return $Future.wrap(
    result.then((e) => e == null ? const $null() : runtime.wrapAlways(e)),
  );
}