getProperties method

  1. @override
Map<String, dynamic> getProperties({
  1. Element? ancestor,
})
override

Implementation

@override
Map<String, dynamic> getProperties({Element? ancestor}) {
  Map<String, dynamic> properties = super.getProperties(ancestor: ancestor);
  final widget = element.widget;

  String? className;

  if (widget is AlertDialog) {
    className = RanorexSupportedClassName.alertDialog;
  } else if (widget is BottomNavigationBar) {
    className = RanorexSupportedClassName.bottomNavigationBar;
  } else if (widget is BottomSheet) {
    className = RanorexSupportedClassName.bottomSheet;
  } else if (widget is ButtonBar) {
    className = RanorexSupportedClassName.buttonBar;
  } else if (widget is Card) {
    className = RanorexSupportedClassName.card;
  } else if (widget is Column) {
    className = RanorexSupportedClassName.column;
  } else if (widget is Container) {
    className = RanorexSupportedClassName.container;
  } else if (widget is Dialog) {
    className = RanorexSupportedClassName.dialog;
  } else if (widget is Divider) {
    className = RanorexSupportedClassName.divider;
  } else if (widget is Drawer) {
    className = RanorexSupportedClassName.drawer;
  } else if (widget is DrawerHeader) {
    className = RanorexSupportedClassName.drawerHeader;
  } else if (widget is GridTile) {
    className = RanorexSupportedClassName.gridTile;
  } else if (widget is GridTileBar) {
    className = RanorexSupportedClassName.gridTileBar;
  } else if (widget is GridView) {
    className = RanorexSupportedClassName.gridView;
  } else if (widget is InkWell) {
    className = RanorexSupportedClassName.inkwell;
  } else if (widget is ListTile) {
    className = RanorexSupportedClassName.listTile;
  } else if (widget is NavigationBar) {
    className = RanorexSupportedClassName.navigationBar;
  } else if (widget is NavigationDrawer) {
    className = RanorexSupportedClassName.navigationDrawer;
  } else if (widget is OverflowBar) {
    className = RanorexSupportedClassName.overflowBar;
  } else if (widget is PopupMenuDivider) {
    className = RanorexSupportedClassName.popupMenuDivider;
  } else if (widget is Row) {
    className = RanorexSupportedClassName.row;
  } else if (widget is Scaffold) {
    className = RanorexSupportedClassName.scaffold;
  } else if (widget is SnackBar) {
    className = RanorexSupportedClassName.snackBar;
  } else if (widget is Stack) {
    className = RanorexSupportedClassName.stack;
  } else if (widget is TabBar) {
    className = RanorexSupportedClassName.tabBar;
  } else if (widget is Tooltip) {
    className = RanorexSupportedClassName.tooltip;
    properties[WidgetProperty.caption.name] = widget.message;
  }

  if (className != null) {
    properties[WidgetProperty.className.name] = className;
    properties[WidgetProperty.containerType.name] =
        widget.runtimeType.toString();
  }

  properties[WidgetProperty.accessibilityLabel.name] =
      element.findAncestorWidgetOfExactType<Semantics>()?.properties.label ??
          '';

  return properties;
}