copyWith method

BlocProvider<T> copyWith(
  1. Widget child
)

Clone the current BlocProvider with a new child Widget.

All other values, including Key and Bloc are preserved.

Implementation

BlocProvider<T> copyWith(Widget child) {
  return BlocProvider<T>.builder(
    key: key,
    creator: creator,
    builder: (_context, _bag) => child,
  );
}