firePress

void firePress()

Fire onPress handler if present

Implementation

void firePress() {
  final onPress = props['onPress'];
  switch (onPress) {
    case final void Function() fn:
      fn();
    case final JSFunction fn:
      fn.callAsFunction();
    case null:
      throw TestingException('No onPress handler on $type');
  }
}