Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

singleton classes in dart example

class Singleton {
  static Singleton _instance;

  Singleton._internal() {
    _instance = this;
  }

  factory Singleton() => _instance ?? Singleton._internal();
}
Source by flutterbyexample.com #
 
PREVIOUS NEXT
Tagged: #singleton #classes #dart
ADD COMMENT
Topic
Name
3+2 =