afterLoad method
The afterLoad method will check if the state is loading
If loading it will display the placeholder
widget.
You can also specify the name of the loadingKey
.
Implementation
Widget afterLoad(
{required Function() child, Widget? placeholder, String? loadingKey}) {
if (isLoading(name: loadingKey ?? "default")) {
Nylo nylo = Backpack.instance.read('nylo');
return placeholder ?? nylo.appLoader;
}
return child();
}