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

@ -23,8 +23,8 @@ class DevicesManagementApi {
: ApiEndpoints.getAllDevices.replaceAll('{projectId}', projectId),
showServerMessage: true,
expectedResponseModel: (json) {
List<dynamic> jsonData = json['data'];
List<AllDevicesModel> devicesList = jsonData.map((jsonItem) {
final List<dynamic> jsonData = json['data'];
final devicesList = jsonData.map((jsonItem) {
return AllDevicesModel.fromJson(jsonItem);
}).toList();
return devicesList;
@ -123,11 +123,11 @@ class DevicesManagementApi {
path: ApiEndpoints.gatewayApi.replaceAll('{gatewayUuid}', gatewayId),
showServerMessage: false,
expectedResponseModel: (json) {
List<DeviceModel> devices = [];
final devices = <DeviceModel>[];
if (json == null || json.isEmpty || json == []) {
return devices;
}
for (var device in json['data']['devices']) {
for (final device in json['data']['devices']) {
devices.add(DeviceModel.fromJson(device));
}
return devices;
@ -203,7 +203,7 @@ class DevicesManagementApi {
}
}
getPowerStatus(List<String> uuids) async {
Future getPowerStatus(List<String> uuids) async {
try {
final queryParameters = {
'devicesUuid': uuids.join(','),
@ -254,8 +254,8 @@ class DevicesManagementApi {
.replaceAll('{category}', category),
showServerMessage: true,
expectedResponseModel: (json) {
List<ScheduleModel> schedules = [];
for (var schedule in json) {
final schedules = <ScheduleModel>[];
for (final schedule in json) {
schedules.add(ScheduleModel.fromMap(schedule));
}
return schedules;
@ -350,7 +350,7 @@ class DevicesManagementApi {
try {
final response = await HTTPService().put(
path: ApiEndpoints.deviceByUuid.replaceAll('{deviceUuid}', deviceId),
body: {"deviceName": deviceName},
body: {'deviceName': deviceName},
expectedResponseModel: (json) {
return json['data'];
},
@ -378,7 +378,7 @@ class DevicesManagementApi {
path: ApiEndpoints.resetDevice.replaceAll('{deviceUuid}', devicesUuid!),
showServerMessage: false,
body: {
"devicesUuid": [devicesUuid]
'devicesUuid': [devicesUuid]
},
expectedResponseModel: (json) {
return json;