14 lines
326 B
Dart
14 lines
326 B
Dart
class BleConfig {
|
|
// 私有构造函数
|
|
BleConfig._() {
|
|
// ✅ 这里就是单例初始化的地方
|
|
// 只会执行一次(第一次获取实例时)
|
|
}
|
|
|
|
// 静态实例
|
|
static final BleConfig _instance = BleConfig._();
|
|
|
|
// 工厂构造函数,提供全局访问点
|
|
factory BleConfig() => _instance;
|
|
}
|