initialize method
Initializes the provider.
Should set initialized to true at the very end of the
implementation.
Implementation
@override
Future<void> initialize({String? userId = ""}) async {
if (initialized) {
return;
}
await service.repository.initialize();
this.userId = userId ?? "";
_data = await service.getAll(userId: userId);
initialized = true;
AppEventsDispatcher().publish(ProviderInitializedEvent(service.repositoryId));
}