subscribeNotifierWidget<M extends ChangeNotifier> method

Widget subscribeNotifierWidget<M extends ChangeNotifier>(
  1. M model,
  2. ConsumerWidgetBuilder<M> childBuilder
)

Implementation

Widget subscribeNotifierWidget<M extends ChangeNotifier>(M model, ConsumerWidgetBuilder<M> childBuilder) {
  return ChangeNotifierProvider<M>(
    create: (_) => model,
    child: Consumer<M>(
      builder: (context, m, _) {
        return childBuilder(context, m);
      },
    ),
  );
}