byKeyContains method

Finder byKeyContains(
  1. Pattern pattern, {
  2. int index = 0,
  3. String? description,
  4. bool skipOffstage = true,
})

Implementation

Finder byKeyContains(
  Pattern pattern, {
  int index = 0,
  String? description,
  bool skipOffstage = true,
}) {
  return find.byWidgetPredicate(
    (widget) {
      if (widget.key is ValueKey<String>) {
        final key = widget.key as ValueKey<String>;
        if (key.value.contains(pattern, index)) {
          return true;
        }
      }
      return false;
    },
    description: description,
    skipOffstage: skipOffstage,
  );
}