isLockedNamed method

bool isLockedNamed(
  1. Finder finder, {
  2. required String name,
})

Check if a named lock is held in a NyPage/NyState widget.

Finds the first NyBaseState via finder and checks its lock map for the given name.

Example:

expect(tester.isLockedNamed(find.byType(MyPage), name: 'submit'), isTrue);

Implementation

bool isLockedNamed(Finder finder, {required String name}) {
  final state = _findNyBaseState(finder);
  if (state != null) {
    return state.isLocked(name);
  }
  return false;
}