Singleton

What is Singleton?

“Singleton is a creational design pattern that ensures that a class has only one instance and also provides a global point of access to it. The motivation for this pattern is stated in the GoF book:

It’s important for some classes to have exactly one instance. Although there can be many printers in a system, there should be only one printer spooler. There should be only one file system and one window manager…

The main idea of this pattern is to make a class itself responsible for keeping track of its sole instance. “

Reference: Flutter Design Patterns: 1 — Singleton

Journal