The argument type 'Widget Function(BuildContext, T, Widget)' can't be assigned to the parameter type 'Widget Function(BuildContext, T, Widget?)'

i have been following a tutorial to implement state management into our flutter web app. This is the tutorial: https://medium.flutterdevs.com/firebase-authentication-using-provider-in-flutter-522841a2ee4d

Now i am creating the "baseView" model for my widgets and am a bit lost because i am new to flutter.

class BaseView<T extends BaseModel> extends StatefulWidget {
  final Widget Function(BuildContext context, T model, Widget child) builder;

  const BaseView({
    @required this.builder,
  });

  @override
  _BaseViewState<T> createState() => _BaseViewState<T>();
}

class _BaseViewState<T extends BaseModel> extends State<BaseView<T>> {
  T model = locator<T>();

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider<T>.value(
      //builder: (context) => model,
      child: Consumer<T>(builder: widget.builder),
      //notifier: model,
      value: model,
    );
  }
}

Firstly i get the error message for the "@required this.builder" part:

The parameter 'builder' can't have a value of 'null' because of its type, but the implicit default value is 'null'.

And for the "Consumer<T>(builder: widget.builder)" part i get this error:

The argument type 'Widget Function(BuildContext, T, Widget)' can't be assigned to the parameter type 'Widget Function(BuildContext, T, Widget?)'.

Link to the Github repo of the project, which is presented in the tutorial: https://github.com/flutter-devs/flutter_auth_provider


Widget Function(BuildContext, T, Widget) cannot accept a null value for the widget, which is required by the Widget Function(BuildContext, T, Widget?) signature.

That's it. Make sense?