screen-locker/stronglift_replacement/workout_app/test/icon_finders.dart
Krzysztof kuhy Rudnicki b6db88f9b9 Make workout app and locker text-free
Painted chrome becomes icons or symbols; old words stay as
spoken labels or code comments. OS window titles kept. Tests
build today from the local day.

Todo: ed07cff3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 00:54:59 +01:00

17 lines
618 B
Dart

/// Finders for icon-only controls (textgate: the old words survive only as
/// the icon's spoken `semanticLabel`).
library;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
/// The [Icon] whose spoken label is exactly [label].
Finder iconLabeled(String label) => find.byWidgetPredicate(
(w) => w is Icon && w.semanticLabel == label,
description: 'Icon labelled "$label"',
);
/// The nearest [T] (a button type) around the icon labelled [label].
Finder buttonLabeled<T extends Widget>(String label) =>
find.ancestor(of: iconLabeled(label), matching: find.byType(T));