Revert "formatted all files."

This reverts commit 04250ebc98.
This commit is contained in:
Faris Armoush
2025-06-12 16:04:49 +03:00
parent 218f43bacb
commit c642ba2644
473 changed files with 4335 additions and 5417 deletions

View File

@ -29,7 +29,7 @@ class SceneApi {
debugPrint('create scene response: $response');
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
@ -52,7 +52,7 @@ class SceneApi {
debugPrint('create automation response: $response');
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
@ -63,7 +63,7 @@ class SceneApi {
path: ApiEndpoints.getIconScene,
showServerMessage: false,
expectedResponseModel: (json) {
final iconsList = <IconModel>[];
List<IconModel> iconsList = [];
json.forEach((element) {
iconsList.add(IconModel.fromJson(element));
});
@ -89,8 +89,8 @@ class SceneApi {
expectedResponseModel: (json) {
final scenesJson = json['data'] as List;
final scenes = <ScenesModel>[];
for (final scene in scenesJson) {
List<ScenesModel> scenes = [];
for (var scene in scenesJson) {
scenes.add(ScenesModel.fromJson(scene, isAutomation: false));
}
return scenes;
@ -114,8 +114,8 @@ class SceneApi {
.replaceAll('{projectId}', projectId),
showServerMessage: false,
expectedResponseModel: (json) {
final scenes = <ScenesModel>[];
for (final scene in json) {
List<ScenesModel> scenes = [];
for (var scene in json) {
scenes.add(ScenesModel.fromJson(scene, isAutomation: true));
}
return scenes;
@ -158,8 +158,7 @@ class SceneApi {
}
//update Scene
static Future updateScene(
CreateSceneModel createSceneModel, String sceneId) async {
static updateScene(CreateSceneModel createSceneModel, String sceneId) async {
try {
final response = await _httpService.put(
path: ApiEndpoints.updateScene.replaceAll('{sceneId}', sceneId),
@ -171,14 +170,14 @@ class SceneApi {
);
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
}
//update automation
static Future updateAutomation(CreateAutomationModel createAutomationModel,
static updateAutomation(CreateAutomationModel createAutomationModel,
String automationId, String projectId) async {
try {
final response = await _httpService.put(
@ -193,7 +192,7 @@ class SceneApi {
);
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
@ -227,7 +226,7 @@ class SceneApi {
);
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
@ -248,7 +247,7 @@ class SceneApi {
);
return response;
} on DioException catch (e) {
final String errorMessage =
String errorMessage =
e.response?.data['error']['message'][0] ?? 'something went wrong';
throw APIException(errorMessage);
}
@ -296,8 +295,8 @@ class SceneApi {
.replaceAll('{projectId}', projectId),
showServerMessage: false,
expectedResponseModel: (json) {
final scenes = <ScenesModel>[];
for (final scene in json) {
List<ScenesModel> scenes = [];
for (var scene in json) {
scenes.add(ScenesModel.fromJson(scene));
}
return scenes;