createFinder method

Finder createFinder(
  1. SerializableFinder finder
)

Creates the flutter widget finder from SerializableFinder.

Implementation

Finder createFinder(SerializableFinder finder) {
  return switch (finder.finderType) {
    'ByText'           => _createByTextFinder(finder as ByText),
    'ByTooltipMessage' => _createByTooltipMessageFinder(finder as ByTooltipMessage),
    'BySemanticsLabel' => _createBySemanticsLabelFinder(finder as BySemanticsLabel),
    'ByValueKey'       => _createByValueKeyFinder(finder as ByValueKey),
    'ByType'           => _createByTypeFinder(finder as ByType),
    'PageBack'         => _createPageBackFinder(),
    'Ancestor'         => _createAncestorFinder(finder as Ancestor),
    'Descendant'       => _createDescendantFinder(finder as Descendant),
    final String type => throw DriverError('Unsupported search specification type $type'),
  };
}