displayResult method

Widget displayResult(
  1. BuildContext context,
  2. ModResourceResult<R>? result
)

Implementation

Widget displayResult(BuildContext context, ModResourceResult<R>? result) {
  if (result != null) {
    switch (result.state) {
      case ResourceState.LOADING:
        return this.buildLoadingState(context);
      case ResourceState.SUCCESS:
        return this.buildSuccessState(context, result.data);
      case ResourceState.ERROR:
        return this.buildErrorState(context, result.error);
      default:
    }
  }
  return this.buildInitialState(context);
}