Skip to content

Fix compile-time error in FeedRepository.updatePost payload construction #27

Description

@syed-reza98

Why

FeedRepository.updatePost() currently constructs a Dart map using invalid syntax (?location, ?taggedPetIds, etc.), which breaks compilation.

Where

  • lib/repositories/feed_repository.dartupdatePost(...)

Tasks

  • Replace invalid map entries with conditional keys:
    • Always include caption
    • Include location only when non-null and non-empty
    • Include tagged_pet_ids / tagged_pet_names only when provided and consistent
  • Ensure omission does not clear existing DB values unintentionally

Acceptance criteria

  • flutter analyze passes
  • App builds and runs
  • Updating caption/location/tags works without errors

References

  • Stability requirement in docs/02_FEATURES_REQUIREMENTS_BEST_PRACTICES.md (error handling + maintainability)
  • Repo lib/ review identified this as a build-breaking defect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions