Lazy Singleton vs Singleton in Dart Lazy Singleton vs Singleton in Dart dart dart

Lazy Singleton vs Singleton in Dart


Both are Singletons. But LazySingleton refers to a class whose resource will not be initialised until its used for the 1st time. It's generally used to save resources and memory.


"Lazy" refers to initiating resources at the time of the first request instead at the time of declaration. More reading on the concept is here: https://en.wikipedia.org/wiki/Lazy_initialization