buildContent method
Implementation
Widget buildContent(BuildContext context) {
final actualStatus = (!isConnected && status == LayoutStatus.loading)
? LayoutStatus.noNetwork
: (status ?? LayoutStatus.success);
switch (actualStatus) {
case LayoutStatus.loading:
return KeyedSubtree(
key: const ValueKey(LayoutStatus.loading),
child: loading ?? loadingWidget(context),
);
case LayoutStatus.empty:
return KeyedSubtree(
key: const ValueKey(LayoutStatus.empty),
child: empty ?? emptyWidget(context),
);
case LayoutStatus.noNetwork:
return KeyedSubtree(
key: const ValueKey(LayoutStatus.noNetwork),
child:
noNetwork ?? noNetworkWidget(context, onReconnect: onReconnect),
);
case LayoutStatus.error:
return KeyedSubtree(
key: const ValueKey(LayoutStatus.error),
child: error ?? errorWidget(context),
);
case LayoutStatus.success:
return KeyedSubtree(
key: const ValueKey(LayoutStatus.success),
child: child,
);
}
}