$new static method

$Value? $new(
  1. Runtime runtime,
  2. $Value? thisValue,
  3. List<$Value?> args
)

Wrapper for the FocusNode.new constructor

Implementation

static $Value? $new(Runtime runtime, $Value? thisValue, List<$Value?> args) {
  return $FocusNode.wrap(
    FocusNode(
      debugLabel: args[0]?.$value,
      onKeyEvent: (FocusNode node, KeyEvent event) {
        return (args[2]! as EvalCallable?)?.call(runtime, null, [
          $FocusNode.wrap(node),
          $KeyEvent.wrap(event),
        ])?.$value;
      },
      skipTraversal: args[3]?.$value ?? false,
      canRequestFocus: args[4]?.$value ?? true,
      descendantsAreFocusable: args[5]?.$value ?? true,
      descendantsAreTraversable: args[6]?.$value ?? true,
    ),
  );
}