Each breed document uses the following format:
Document ID: {species}_{slug}
- Examples:
cat_abyssinian,dog_akita,cat_maine_coon
{
"species": "cat" | "dog",
"name": "Abyssinian",
"slug": "abyssinian",
"attributes": {
"Affectionate with Family": 3,
"Amount of Shedding": 3,
"Easy to Groom": 3,
"General Health": 2,
"Intelligence": 5,
"Kid Friendly": 5,
"Pet Friendly": 5,
"Potential for Playfulness": 5
},
"createdAt": "2025-09-04T14:30:00Z",
"updatedAt": "2025-09-04T14:30:00Z"
}name_tr: Turkish translation of breed nameimageUrl: URL to breed imagedescription: Breed descriptiondescription_tr: Turkish description
- Unified Collection: Changed from separate
cat_breedsanddog_breedscollections to a singlebreedscollection - Document ID Format: Now uses
{species}_{slug}format (e.g.,cat_abyssinian) - Species Field: Changed from
typetospecieswith values "cat" or "dog" - Attributes: Changed from
characteristicstoattributes - Slug Field: Added for cleaner URL-friendly identifiers
- Updated to import to unified
breedscollection - Creates document IDs with species prefix
- Automatically generates slugs from breed names
- Updated all methods to query the unified collection
- Uses
speciesfield for filtering cats vs dogs - Updated method signatures to use
speciesinstead oftype
- Updated field names:
type→species,characteristics→attributes - Added
slugfield - Updated all getters and methods accordingly
final catBreeds = await BreedService.getCatBreeds();final dogBreeds = await BreedService.getDogBreeds();final results = await BreedService.searchBreeds('persian', 'cat');final breed = await BreedService.getBreed('cat', 'persian');final friendlyBreeds = await BreedService.getBreedsByAttribute(
'dog',
'Kid Friendly',
4
);The breed data is automatically imported when the app starts:
- Checks if breeds already exist in Firestore
- If not, loads from
assets/cat-and-dog-breeds.json - Processes and imports all breeds with proper document IDs and structure
- Only imports once to avoid duplicates
For development and testing, these methods are available:
BreedImportService.forceImportBreeds(): Force re-import all breedsBreedImportService.clearAllBreeds(): Clear all breeds from Firestore