mainWidget method

  1. @override
Widget mainWidget(
  1. BuildContext context,
  2. ScreenManagerCubitState state
)

The primary screen content.

Called when no error page state is active. state is the current ScreenManagerCubitState and can be inspected if needed, but most implementations can ignore it.

Implementation

@override
Widget mainWidget(BuildContext context, ScreenManagerCubitState state) {
  return BlocProvider<BlocxCollectionBloc<T, P>>.value(
    value: _bloc,
    child: BlocConsumer<BlocxCollectionBloc<T, P>, BlocxCollectionState<T>>(
      buildWhen: (_, s) => s.shouldRebuild,
      listenWhen: (_, s) => s.shouldListen,
      listener: _listListener,
      builder: collectionWrapperBuilder,
    ),
  );
}