toJson method

Future<FormData> toJson()

Converts this AttendanceImageRequestModel instance to a FormData object.

Implementation

Future<FormData> toJson() async {
  return FormData.fromMap({
    'image': await MultipartFile.fromFile(
      image.path,
      filename: image.path.split('/').last,
    ),
    'type': type.convertToString(),
    'date': date.toIso8601String(),
    'status': workingFrom.convertToString(),
  });
}