diff --git a/src/main/java/io/github/ashwith/flutter/FlutterFinder.java b/src/main/java/io/github/ashwith/flutter/FlutterFinder.java index 6feb6d8..1913d61 100644 --- a/src/main/java/io/github/ashwith/flutter/FlutterFinder.java +++ b/src/main/java/io/github/ashwith/flutter/FlutterFinder.java @@ -85,8 +85,8 @@ public FlutterElement byText(String input) { public FlutterElement byAncestor(FlutterElement of, FlutterElement matching, boolean matchRoot, boolean firstMatchOnly) { Map matchIdentifier = new HashMap<>(ImmutableMap.of( FINDER_TYPE, "Ancestor", - "matchRoot", "true", - "firstMatchOnly", "false" + "matchRoot", matchRoot, + "firstMatchOnly", firstMatchOnly )); matchIdentifier.put("of", of.getRawMap()); matchIdentifier.put("matching", matching.getRawMap()); @@ -100,8 +100,8 @@ public FlutterElement byAncestor(FlutterElement of, FlutterElement matching, boo public FlutterElement byDescendant(FlutterElement of, FlutterElement matching, boolean matchRoot, boolean firstMatchOnly) { Map matchIdentifier = new HashMap<>(ImmutableMap.of( FINDER_TYPE, "Descendant", - "matchRoot", "true", - "firstMatchOnly", "false" + "matchRoot", matchRoot, + "firstMatchOnly", firstMatchOnly )); matchIdentifier.put("of", of.getRawMap()); matchIdentifier.put("matching", matching.getRawMap());