get method

Future<ApiResponseModel<GroupModel?>> get({
  1. required String id,
})

Retrieves a group from the group list.

id is the ID of the group to retrieve. Returns a GroupModel instance if successful, or null if there's an error.

Implementation

Future<ApiResponseModel<GroupModel?>> get({required String id}) async {
  final url = "$_baseUrl/group/$id";

  debugPrint("flutter_mon_sms_pro/group/get/payload: $id");

  final r = await _dio.post(url, data: {
    "id": id,
    "apiKey": _apiKey,
  });

  debugPrint("flutter_mon_sms_pro/group/get/data: ${r.data}");

  final response = ApiResponseModel.fromJson(
      r.data, (data) => GroupModel.fromJson(data as Map<String, dynamic>));

  return response;
}