type '(BuildContext, Widget) => ChangeNotifierProvider' is not a subtype of type '(BuildContext, Widget?) => Widget' in type cast
Hi, I am facing above error on my old project while I was converting it to Flutter 2.5, can anyone help me to figure it out?
abstract class Role {
Widget homeBuilder(BuildContext context);
Map<String, WidgetBuilder>? routes;
/// The navigatorBuilder allows you to insert widgets between MaterialApp and its Navigator.
/// This is useful for providing the logged in Talent or Recruiter
TransitionBuilder? navigatorBuilder;
}
@override
TransitionBuilder navigatorBuilder =
(BuildContext context, Widget navigator) {
String token = Provider.of<AuthBloc>(context).token;
MyNotifications.setUpFirebaseMessaging(context);
return ChangeNotifierProvider<Talent>(
create: (ctx) =>
(Provider.of<AuthBloc>(context).role as TalentRole).talent
..setAuthToken(token),
child: navigator,
);
};