ancestor method Null safety

SerializableFinder ancestor(
  1. {required SerializableFinder of,
  2. required SerializableFinder matching,
  3. bool matchRoot = false,
  4. bool firstMatchOnly = false}
)

Finds the widget that is an ancestor of the of parameter and that matches the matching parameter.

If the matchRoot argument is true then the widget specified by of will be considered for a match. The argument defaults to false.

If firstMatchOnly is true then only the first ancestor matching matching will be returned. Defaults to false.

Implementation

SerializableFinder ancestor({
  required SerializableFinder of,
  required SerializableFinder matching,
  bool matchRoot = false,
  bool firstMatchOnly = false,
}) => Ancestor(of: of, matching: matching, matchRoot: matchRoot, firstMatchOnly: firstMatchOnly);