get method
Retrieves a sender from the sender list.
id is the ID of the sender to retrieve.
Returns a SenderModel instance if successful, or null if there's an error.
Implementation
Future<ApiResponseModel<SenderModel?>> get({required String id}) async {
final url = "$_baseUrl/sender/$id";
final payload = {
'id': id,
};
debugPrint("flutter_mon_sms_pro/sender/get/payload: $payload");
final r = await _dio.post(url, data: {
...payload,
"apiKey": _apiKey,
});
debugPrint("flutter_mon_sms_pro/sender/get/data: ${r.data}");
final response = ApiResponseModel.fromJson(
r.data, (data) => SenderModel.fromJson(data as Map<String, dynamic>));
return response;
}