Last active
April 23, 2022 17:29
-
-
Save JaveedIshaq/c18dfb253962e519ec29345736776a34 to your computer and use it in GitHub Desktop.
how to create a singleton instance of a class in dart flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContactBook { | |
ContactBook._sharedInstance(); | |
static final ContactBook _shared = ContactBook._sharedInstance(); | |
factory ContactBook() => _shared; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment