📜  飞镖示例中的单例类 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:55.604000             🧑  作者: Mango

代码示例1
class Singleton {
  static Singleton _instance;

  Singleton._internal() {
    _instance = this;
  }

  factory Singleton() => _instance ?? Singleton._internal();
}