Dart 单例模式
2019-02-14 本文已影响4人
初见破晓
class ShardPreferencesUtil {
ShardPreferencesUtil._();
static ShardPreferencesUtil _instance;
static ShardPreferencesUtil getInstance() {
if (_instance == null) {
_instance = ShardPreferencesUtil._();
}
return _instance;
}
}