I'm using GetIt and Injectable, and I have some trouble with GetIt.
It seems that I'm not registering my DiscordRepository class, but I can't registering it with a @injectable decorator since it's an abstract class.
What should I do in this case ?
I initialised my dependency injection like so:
final getFromDependencyGraph = GetIt.instance;
@injectableInit
Future<void> setupDependencyInjection() async {
await $initGetIt(getFromDependencyGraph);
}
The flutter pub run build_runner build give me this output:
[WARNING] injectable_generator:injectable_config_builder on lib/misc/dependencies.dart:
Missing dependencies in discordlogin/misc/dependencies.dart
[AuthenticationService] depends on unregistered type [DiscordRepository] from package:discordlogin/data/repository/discord_repository.dart
Did you forget to annotate the above class(s) or their implementation with @injectable?
My full code is here: https://github.com/BLKKKBVSIK/DiscordLogin Build it for web. Then launch the app and click on the FAB at the bottom right of the screen to see the error in the app.