BlocProvider<T extends Bloc>.fromBuilder constructor

BlocProvider<T extends Bloc>.fromBuilder({
  1. required BlocBuilder<T> builder,
  2. required Widget child,
})

builder is used to create the bloc to be provided.

Implementation

factory BlocProvider.fromBuilder({
  required BlocBuilder<T> builder,
  required Widget child,
}) =>
    BlocProvider(
      create: (context, channel) =>
          builder.builder(context.asReadable(), channel),
      child: child,
    );