toggleButton method

Future<void> toggleButton(
  1. dynamic text,
  2. bool value
)

Toggles a button specified by its text to ensure the given value.

Implementation

Future<void> toggleButton(dynamic text, bool value) async {
  final finder = find.toggleButton(text);
  if (isChecked.matches(finder, {}) != value) {
    return tap(finder);
  }
}