toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  Map<String, dynamic> json = {
    'id': id,
    'name': name,
    'location': location,
    'responsibleForInformation': responsibleForInformation,
    'url': url,
    'imageUrl': imageUrl,
    'whereItIsRealized': whereItIsRealized,
    'summaryDescription': summaryDescription,
    'practicalImplementationOfThePractice': practicalImplementationOfThePractice,
    'typeOfAgroecologicalPractice': typeOfAgroecologicalPractice,
    'whyYouUseAndWhatYouExpectFromThisPractice': whyYouUseAndWhatYouExpectFromThisPractice,
    'doesItHelpRestoreLand': doesItHelpRestoreLand,
    'climateChangeVulnerabilityEffects': climateChangeVulnerabilityEffects,
    'timeRequirements': timeRequirements,
    'generalPerformanceOfPracticeDetails': generalPerformanceOfPracticeDetails,
    'unintendedPositiveSideEffectsOfPracticeDetails': unintendedPositiveSideEffectsOfPracticeDetails,
    'unintendedNegativeSideEffectOfPracticeDetails': unintendedNegativeSideEffectOfPracticeDetails,
    'knowledgeAndSkillsRequiredForPracticeDetails': knowledgeAndSkillsRequiredForPracticeDetails,
    'labourRequiredForPracticeDetails': labourRequiredForPracticeDetails,
    'costAssociatedWithPracticeDetails': costAssociatedWithPracticeDetails,
    'doesItWorkInDegradedEnvironmentsDetails': doesItWorkInDegradedEnvironmentsDetails,
    'doesItHelpRestoreLandDetails': doesItHelpRestoreLandDetails,
    'climateChangeVulnerabilityEffectsDetails': climateChangeVulnerabilityEffectsDetails,
    'timeRequirementsDetails': timeRequirementsDetails,
    'knowledgeSource': knowledgeSource,
    'knowledgeTiming': knowledgeTiming,
    'knowledgeProducts': knowledgeProducts,
    'uptakeMotivation': uptakeMotivation,
    'knowledgeSourceDetails': knowledgeSourceDetails,
    'knowledgeTimingDetails': knowledgeTimingDetails,
    'account_id': int.parse(accountId),
    'location_id': int.parse(locationId),
  };

  if (base64Image.isNotEmpty) {
    json['base64Image'] = base64Image;
  }

  return json;
}