formatted all files.

This commit is contained in:
Faris Armoush
2025-06-12 15:33:32 +03:00
parent 29959f567e
commit 04250ebc98
474 changed files with 5425 additions and 4338 deletions

View File

@ -12,7 +12,8 @@ class AccessMangApi {
void _validateEndpoints() {
if (!ApiEndpoints.getDevices.contains('{projectId}')) {
throw Exception("Endpoint 'getDevices' must contain '{projectId}' placeholder.");
throw Exception(
"Endpoint 'getDevices' must contain '{projectId}' placeholder.");
}
}
@ -22,8 +23,8 @@ class AccessMangApi {
path: ApiEndpoints.visitorPassword,
showServerMessage: true,
expectedResponseModel: (json) {
List<dynamic> jsonData = json['data'] ?? [];
List<PasswordModel> passwordList = jsonData.map((jsonItem) {
final List<dynamic> jsonData = json['data'] ?? [];
final passwordList = jsonData.map((jsonItem) {
return PasswordModel.fromJson(jsonItem);
}).toList();
return passwordList;
@ -46,8 +47,8 @@ class AccessMangApi {
},
showServerMessage: true,
expectedResponseModel: (json) {
List<dynamic> jsonData = json['data'] ?? [];
List<DeviceModel> deviceList = jsonData.map((jsonItem) {
final List<dynamic> jsonData = json['data'] ?? [];
final deviceList = jsonData.map((jsonItem) {
return DeviceModel.fromJson(jsonItem);
}).toList();
return deviceList;
@ -69,13 +70,13 @@ class AccessMangApi {
final response = await HTTPService().post(
path: ApiEndpoints.visitorPassword,
body: jsonEncode({
"email": email,
"passwordName": passwordName,
"password": password,
"devicesUuid": devicesUuid,
"effectiveTime": effectiveTime,
"invalidTime": invalidTime,
"operationType": "ONLINE_ONE_TIME",
'email': email,
'passwordName': passwordName,
'password': password,
'devicesUuid': devicesUuid,
'effectiveTime': effectiveTime,
'invalidTime': invalidTime,
'operationType': 'ONLINE_ONE_TIME',
}),
showServerMessage: true,
expectedResponseModel: (json) {
@ -93,17 +94,18 @@ class AccessMangApi {
String? passwordName,
List<Schedule>? scheduleList,
List<String>? devicesUuid}) async {
Map<String, dynamic> body = {
"email": email,
"devicesUuid": devicesUuid,
"passwordName": passwordName,
"password": password,
"effectiveTime": effectiveTime,
"invalidTime": invalidTime,
"operationType": "ONLINE_MULTIPLE_TIME",
final body = <String, dynamic>{
'email': email,
'devicesUuid': devicesUuid,
'passwordName': passwordName,
'password': password,
'effectiveTime': effectiveTime,
'invalidTime': invalidTime,
'operationType': 'ONLINE_MULTIPLE_TIME',
};
if (scheduleList != null) {
body["scheduleList"] = scheduleList.map((schedule) => schedule.toJson()).toList();
body['scheduleList'] =
scheduleList.map((schedule) => schedule.toJson()).toList();
}
final response = await HTTPService().post(
path: ApiEndpoints.visitorPassword,
@ -123,10 +125,10 @@ class AccessMangApi {
final response = await HTTPService().post(
path: ApiEndpoints.visitorPassword,
body: jsonEncode({
"operationType": "OFFLINE_ONE_TIME",
"email": email,
"passwordName": passwordName,
"devicesUuid": devicesUuid
'operationType': 'OFFLINE_ONE_TIME',
'email': email,
'passwordName': passwordName,
'devicesUuid': devicesUuid
}),
showServerMessage: true,
expectedResponseModel: (json) {
@ -145,12 +147,12 @@ class AccessMangApi {
final response = await HTTPService().post(
path: ApiEndpoints.visitorPassword,
body: jsonEncode({
"email": email,
"devicesUuid": devicesUuid,
"passwordName": passwordName,
"effectiveTime": effectiveTime,
"invalidTime": invalidTime,
"operationType": "OFFLINE_MULTIPLE_TIME",
'email': email,
'devicesUuid': devicesUuid,
'passwordName': passwordName,
'effectiveTime': effectiveTime,
'invalidTime': invalidTime,
'operationType': 'OFFLINE_MULTIPLE_TIME',
}),
showServerMessage: true,
expectedResponseModel: (json) {