As the question implies, I am trying to create an AutoDisposeAsyncNotifierProviderFamily. I currently have this:
final participantProvider = AsyncNotifierProvider.autoDispose.family<
ParticipantNotifier,
Map<String, List<String>>,
String
>((ref, id) => ParticipantNotifier(id));
class ParticipantNotifier extends AsyncNotifier<Map<String, List<String>>> {
ParticipantNotifier(this.id);
final String id;
@override
FutureOr<Map<String, List<String>>> build() {
// Get some participants for this event's id
}
}
(extra indents and linebreaks added for readability). However, I get the error: The argument type 'ParticipantNotifier Function(dynamic, dynamic)' can't be assigned to the parameter type 'ParticipantNotifier Function()'
. I don't get why the parameter has type ParticipantNotifier Function()
even if I add the family modifier. With some other simpler providers I successfully created Families with a similar syntax. Any help much appreciated!