getProperties method

  1. @override
Map<String, dynamic> getProperties()
override

Implementation

@override
Map<String, dynamic> getProperties() {
  Map<String, dynamic> properties = super.getProperties();

  if (element.widget is ElevatedButton) {
    ElevatedButton buttonWidget = element.widget as ElevatedButton;
    properties[WidgetProperty.enabled.name] = buttonWidget.onPressed != null;
    if (buttonWidget.child is Text) {
      properties[WidgetProperty.text.name] =
          (buttonWidget.child as Text).data ?? '';
    }
  }

  if (element.widget is TextButton) {
    TextButton textButton = element.widget as TextButton;
    properties[WidgetProperty.enabled.name] = textButton.onPressed != null;
    if (textButton.child is Text) {
      properties[WidgetProperty.text.name] =
          (textButton.child as Text).data ?? '';
    }
  }

  properties[WidgetProperty.className.name] =
      RanorexSupportedClassName.uiButton;

  return properties;
}