afterLoad method

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

The afterLoad method will check if the state is loading If loading it will display the loading widget. You can also specify the name of the loadingKey.

Implementation

Widget afterLoad(
    {required Function() child, Widget? loading, String? loadingKey}) {
  if (isLoading(name: loadingKey ?? "default")) {
    return loading ?? Nylo.appLoader();
  }
  return child();
}