Open datnguyennt opened 5 months ago
+1
Hello sir, I have a concern about dependency injection with using get_it. Could you explain why you use a singleton for bloc and cubit, and factory for the other apply in your project? Thank you! https://github.com/RivaanRanawat/blog-app-clean-architecture/blob/master/lib/init_dependencies.main.dart
Hi there @datnguyennt , we use singleton whenever we want to ensure that only a single instance of a class is created and there are no duplicate instances, besides factory is used to create multiple instances of a class generally scoped to a route in order to use that particular instance for achieving a particular task
Hello sir, I have a concern about dependency injection with using get_it. Could you explain why you use a singleton for bloc and cubit, and factory for the other apply in your project? Thank you! https://github.com/RivaanRanawat/blog-app-clean-architecture/blob/master/lib/init_dependencies.main.dart