toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "error": error,
    "id": id,
    "progress": progress,
    "resultFilePath": resultFilePath,
    "resumeDataBase64": resumeDataBase64,
    "state": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => state?.toNativeValue(),
      EnumMethod.value => state?.toValue(),
      EnumMethod.name => state?.name(),
    },
    "url": url?.toString(),
  };
}