finished adding tasks and removing them , added error handling

This commit is contained in:
ashrafzarkanisala
2024-06-26 20:32:34 +03:00
parent ae47e48832
commit 9fe25b9bd3
22 changed files with 605 additions and 231 deletions

View File

@ -3,7 +3,7 @@ import 'dart:async';
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/functions.dart';
import 'package:syncrow_app/features/devices/model/function_model.dart';
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
import 'package:syncrow_app/services/api/http_service.dart';
@ -57,12 +57,12 @@ class DevicesAPI {
}
/// Get Device Functions
static Future<FunctionsEntity> deviceFunctions(String deviceId) async {
static Future<FunctionModel> deviceFunctions(String deviceId) async {
final response = await _httpService.get(
path: ApiEndpoints.deviceFunctions.replaceAll('{deviceUuid}', deviceId),
showServerMessage: false,
expectedResponseModel: (json) {
final functions = FunctionsEntity.fromJson(json);
final functions = FunctionModel.fromJson(json);
return functions;
},
);