scrollingBodyBuilder method

  1. @override
Widget scrollingBodyBuilder(
  1. BuildContext context,
  2. SheetState? sheetState,
  3. ScrollController scrollController,
  4. int pageIndex,
  5. bool scrollLock,
  6. double footerHeight,
)

Implementation

@override
Widget scrollingBodyBuilder(BuildContext context, SheetState? sheetState, ScrollController scrollController, int pageIndex, bool scrollLock, double footerHeight) {
  return StoreConnector<GiphyState, GiphyState>(
    converter: (store) => store.state,
    builder: (context, state){

      final extent = sheetState?.extent ?? 0;

      if(state.displayAssets.length == 0 && !state.connectivity){

        final connectivityIndicator =  delegate.connectivityIndicator(context, extent);

        return connectivityIndicator == null ? connectivityIndicatorExample() : connectivityIndicator;
      }
      else if(state.displayAssets.length > 0){
        return assetsGridBuilder(context, extent, scrollController, scrollLock, footerHeight, state.displayAssets);
      }
      else{
        return delegate.loadingIndicator(context) ?? loadingIndicatorExample(context);
      }
    }
  );
}