$getProperty method

  1. @override
$Value? $getProperty(
  1. Runtime runtime,
  2. String identifier
)

Get a property by identifier on this instance

Implementation

@override
$Value? $getProperty(Runtime runtime, String identifier) {
  switch (identifier) {
    case 'onPressed':
      final _onPressed = $value.onPressed;
      return _onPressed == null
          ? const $null()
          : $Function((runtime, target, args) {
              _onPressed();
              return const $null();
            });

    case 'onLongPress':
      final _onLongPress = $value.onLongPress;
      return _onLongPress == null
          ? const $null()
          : $Function((runtime, target, args) {
              _onLongPress();
              return const $null();
            });

    case 'onHover':
      final _onHover = $value.onHover;
      return _onHover == null
          ? const $null()
          : $Function((runtime, target, args) {
              _onHover(args[0]!.$value);
              return const $null();
            });

    case 'onFocusChange':
      final _onFocusChange = $value.onFocusChange;
      return _onFocusChange == null
          ? const $null()
          : $Function((runtime, target, args) {
              _onFocusChange(args[0]!.$value);
              return const $null();
            });

    case 'style':
      final _style = $value.style;
      return _style == null ? const $null() : $ButtonStyle.wrap(_style);

    case 'clipBehavior':
      final _clipBehavior = $value.clipBehavior;
      return _clipBehavior == null
          ? const $null()
          : $Clip.wrap(_clipBehavior);

    case 'focusNode':
      final _focusNode = $value.focusNode;
      return _focusNode == null ? const $null() : $FocusNode.wrap(_focusNode);

    case 'autofocus':
      final _autofocus = $value.autofocus;
      return $bool(_autofocus);

    case 'statesController':
      final _statesController = $value.statesController;
      return _statesController == null
          ? const $null()
          : $WidgetStatesController.wrap(_statesController);

    case 'isSemanticButton':
      final _isSemanticButton = $value.isSemanticButton;
      return _isSemanticButton == null
          ? const $null()
          : $bool(_isSemanticButton);

    case 'tooltip':
      final _tooltip = $value.tooltip;
      return _tooltip == null ? const $null() : $String(_tooltip);

    case 'child':
      final _child = $value.child;
      return _child == null ? const $null() : $Widget.wrap(_child);

    case 'enabled':
      final _enabled = $value.enabled;
      return $bool(_enabled);
    case 'defaultStyleOf':
      return __defaultStyleOf;

    case 'themeStyleOf':
      return __themeStyleOf;
  }
  return _superclass.$getProperty(runtime, identifier);
}