Dart单例模式最佳实践

/// Created by Capt. Michael @ CaptNotes.com on 02/17/2020.
class Singleton {
  Singleton._();

  static final _instance = Singleton._();

  factory Singleton.getInstance() => _instance;
}
posted @ 2020-02-18 18:33  麦机长  阅读(2763)  评论(1编辑  收藏  举报