2023-07-27 15:29:37 +08:00
|
|
|
// import 'package:hookii_robot/get_dom/services/store_service.dart';
|
|
|
|
|
// import '../../get_dom/network/api_models/login/LoginEntity.dart';
|
|
|
|
|
// import '../mower_manager/model_equipment.dart';
|
2023-08-02 09:22:39 +08:00
|
|
|
import '../../login/login/entity/LoginData.dart' as ud;
|
2023-07-27 15:29:37 +08:00
|
|
|
import '../../login/login/entity/LoginEntity.dart';
|
|
|
|
|
import '../store_service.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClientManager {
|
|
|
|
|
ClientManager._init(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
static ClientManager? _manager;
|
|
|
|
|
|
|
|
|
|
static ClientManager shareManager(){
|
|
|
|
|
_manager ??= ClientManager._init();
|
|
|
|
|
return _manager!;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
factory ClientManager() => shareManager();
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
List<ud.LoginData> devices = <ud.LoginData>[];
|
2023-07-27 15:29:37 +08:00
|
|
|
|
|
|
|
|
String vCode = '',cardText = '',password = '';
|
|
|
|
|
bool isEmail = true;
|
|
|
|
|
|
|
|
|
|
bool hasCheckedAppVersion = false;
|
|
|
|
|
|
|
|
|
|
// void updateDevice(ud.Data data) {
|
|
|
|
|
// int idx = devices.indexWhere((element) => element.serialNumber == data.serialNumber);
|
|
|
|
|
// if(idx == -1) {
|
|
|
|
|
// devices.add(ud.Data.fromJson(data.toJson()));
|
|
|
|
|
// }else {
|
|
|
|
|
// devices[idx] = ud.Data.fromJson(data.toJson());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// bool checkAlias(String name) {
|
|
|
|
|
// int idx = devices.indexWhere((element) => element.alias == name);
|
|
|
|
|
// return idx != -1;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
void resetDevices() => devices = [];
|
|
|
|
|
|
|
|
|
|
Future logOff() async {
|
2023-08-02 09:22:39 +08:00
|
|
|
// await StoreService.to.removeUserInfo();
|
2023-07-27 15:29:37 +08:00
|
|
|
resetDevices();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
// Future loginSuccess({LoginEntity? loginEntity,bool byToken = false}) async {
|
|
|
|
|
// if(byToken){
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// await StoreService.to.saveLogInInfo(loginEntity!);
|
|
|
|
|
// }
|
2023-07-27 15:29:37 +08:00
|
|
|
|
|
|
|
|
}
|