getInstance static method
Implementation
static Future<DirectoryUtil?> getInstance() async {
if (_singleton == null) {
await _lock.synchronized(() async {
if (_singleton == null) {
// keep local instance till it is fully initialized.
// 保持本地实例直到完全初始化。
var singleton = DirectoryUtil._();
await singleton._init();
_singleton = singleton;
}
});
}
return _singleton;
}