get method
Gets device information by device ID.
deviceId is the unique device identifier.
Returns the DeviceModel instance.
Implementation
Future<ApiResponseModel<DeviceModel?>> get({
required String deviceId,
}) async {
final url = "$_baseUrl/device";
final payload = {
'apiKey': _apiKey,
'deviceId': deviceId,
};
debugPrint("flutter_mon_sms_pro/device/get/payload: $payload");
final r = await _dio.post(url, data: payload);
debugPrint("flutter_mon_sms_pro/device/get/data: ${r.data}");
final response = ApiResponseModel.fromJson(
r.data,
(data) => DeviceModel.fromJson(data as Map<String, dynamic>),
);
return response;
}