byDescendant static method

String byDescendant({
  1. required String of,
  2. required String matching,
  3. bool matchingRoot = false,
  4. bool firstMatchOnly = false,
})

Returns base64 encoded string as a finder for appium-flutter-driver with the given of, matching and matchingRoot. https://github.com/truongsinh/appium-flutter-driver#finders

Please read https://api.flutter.dev/flutter/flutter_driver/CommonFinders/descendant.html for more details about each arguments.

var finder = AppiumFlutterFinder.byDescendant(
                 of: AppiumFlutterFinder.byDescendant(
                     of: AppiumFlutterFinder.pageBack(),
                     matching: AppiumFlutterFinder.pageBack(),
                     matchingRoot: false),
                 matching: AppiumFlutterFinder.byDescendant(
                     of: AppiumFlutterFinder.pageBack(),
                     matching: AppiumFlutterFinder.pageBack(),
                     matchingRoot: false),
                 matchingRoot: false
                 firstMatchOnly: false)
var element = driver.getElement(finder);
await element.click();  // Do actions against the element

Implementation

static String byDescendant(
    {required String of,
    required String matching,
    bool matchingRoot = false,
    bool firstMatchOnly = false}) {
  return AppiumFlutterFinder._byAncestorOrDescendant(
      'Descendant', of, matching, matchingRoot, firstMatchOnly);
}