create method

Future<RecipientModel> create(
  1. String formId, {
  2. double? longitude,
  3. double? latitude,
})

Implementation

Future<RecipientModel> create(String formId,
    {double? longitude, double? latitude}) async {
  final Map<String, dynamic> queryParameters = {'form': formId};
  if (longitude != null) queryParameters['lng'] = longitude;
  if (latitude != null) queryParameters['lat'] = latitude;
  final response = await dio.post('/mail', queryParameters: queryParameters);
  return RecipientModel.fromJson(response.data);
}