bySemanticsLabelWithRegExp static method

String bySemanticsLabelWithRegExp(
  1. String label
)

Returns base64 encoded string as a finder for appium-flutter-driver with the given label. It should be Regex as string. https://github.com/truongsinh/appium-flutter-driver#finders https://api.flutter.dev/flutter/dart-core/RegExp-class.html

var finder = AppiumFlutterFinder.bySemanticsLabelWithRegExp('(\w+)')
var element = driver.getElement(finder);
await element.click();  // Do actions against the element

Implementation

static String bySemanticsLabelWithRegExp(String label) {
  print(label.toString());

  return base64.encode(utf8.encode(json.encode({
    'finderType': 'BySemanticsLabel',
    'isRegExp': true,
    'label': label
  }).toString()));
}