afterNotLocked method

Widget afterNotLocked(
  1. String name, {
  2. required dynamic child(),
  3. Widget? loading,
})

The afterNotLocked method will check if the state is locked, if the state is locked it will display the loading widget.

Implementation

Widget afterNotLocked(String name,
    {required Function() child, Widget? loading}) {
  if (isLocked(name)) {
    return loading ?? Nylo.appLoader();
  }
  return child();
}