mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
switch functionality initial implantation
This commit is contained in:
18
lib/services/api/devices_api.dart
Normal file
18
lib/services/api/devices_api.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
|
||||
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
|
||||
import 'package:syncrow_app/services/api/http_service.dart';
|
||||
|
||||
class DevicesAPI {
|
||||
static Future<Map<String, dynamic>> controlDevice(
|
||||
DeviceControlModel controlModel) async {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.control,
|
||||
body: controlModel.toJson(),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user