{"id":23483462,"url":"https://github.com/kikuchy/stove","last_synced_at":"2026-05-08T17:38:46.430Z","repository":{"id":56840617,"uuid":"262106982","full_name":"kikuchy/stove","owner":"kikuchy","description":"Strongly typed wrapper library for cloud_firestore for Flutter. Happy yummy Firestore life for you! 🔥🍳","archived":false,"fork":false,"pushed_at":"2020-05-13T04:59:23.000Z","size":83,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-14T05:25:19.627Z","etag":null,"topics":["dart","firebase","firestore","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/stove","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kikuchy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-07T16:49:18.000Z","updated_at":"2020-09-08T06:03:20.000Z","dependencies_parsed_at":"2022-08-29T01:51:12.358Z","dependency_job_id":null,"html_url":"https://github.com/kikuchy/stove","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kikuchy/stove","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchy%2Fstove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchy%2Fstove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchy%2Fstove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchy%2Fstove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kikuchy","download_url":"https://codeload.github.com/kikuchy/stove/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchy%2Fstove/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32791006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","firebase","firestore","flutter"],"created_at":"2024-12-24T21:12:01.834Z","updated_at":"2026-05-08T17:38:46.404Z","avatar_url":"https://github.com/kikuchy.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stove 🔥🍳\n\n*Stove* is the thin, but strongly typed wrapper library for [cloud_firestore](https://pub.dev/packages/cloud_firestore).\n\nNow you can,\n\n* take advantages of the type checker of Dart language\n* avoid runtime errors due to `dynamic` arguments of `cloud_firestore`\n* avoid typos due to using raw String literals for the name of document's fields\n\nStove provides you a happy yummy Firestore life for you! 🔥🍳\n\n## Using\n\n### Define the document class\n\n ```dart\n/// User document\nclass User {}\n```\n\nThat's it!\n\nAlso, you can add fields for this class if you want.\n\n### Define fields of the document\n\n```dart\n// The document `User` has fields named `name` and `gender`.\nclass UserField\u003cFT, LT\u003e implements Field\u003cUser, FT, LT\u003e {\n  final String name;\n  final Converter\u003cFT, LT\u003e storeToLocal;\n  final Converter\u003cLT, FT\u003e localToStore;\n\n  const UserField._(this.name, this.storeToLocal, this.localToStore);\n\n  static const name$ = UserField\u003cString, String\u003e._(\"name\", identity, identity);\n  static final gender = UserField._(\n        \"gender\",\n            (f) =\u003e Gender.values.where((g) =\u003e g.toString().contains(f)).first,\n            (l) =\u003e l.toString().split(\".\")[1]);\n}\n```\n\nThe class represents the field of the document should extend `Field\u003cT, FT, LT\u003e`.\n`T` should be unique by each document.\n`FT` means \"Type in Firesore\".\n`LT` means \"Type in the local environment\".\n\nYou can define your own converters that converts `FT` and `LT`.\nYou can use all type of instance if you write converters.\nIf you don't want to convert the value, put `identity` converter (it through arguments).\n\n### Define children of the document\n\n```dart\n// The document `User` has a child (sub collection) named `friends`.\nclass UserChildren\u003cC\u003e implements SubCollection\u003cUser, C\u003e {\n  final String name;\n\n  const UserChildren._(this.name);\n\n  static const friends = UserChildren\u003cFriend\u003e._(\"friends\");\n}\n```\n\nThe class represents the child (sub collection) should extend `SubCollection\u003cC\u003e`.\n`C` is the class represents the document of the element of that collection. \n\n\n\n### Using document reference\n\n```dart\n// Create the reference of new document\nfinal userReference = Stove.instance.collection\u003cUser\u003e(\"/users\").document();\n\n// Save data\nawait userReference.setData(DocumentDifference()\n  ..set(UserFields.name$, \"Bob\")\n  ..set(UserFields.gender, Gender.male)\n);\n\n// Update data\nawait userReference.updateData(DocumentDifference()\n  ..set(UserFields.name$, \"John\")\n  ..delete(UserFields.gender)\n);\n// Delete data\n\nawait userReference.delete();\n\n// Get the snapshot\nfinal userSnapshot = await userReference.get();\nfinal name = userSnapshot.data.get(UserFields.name$);    // name: String\nfinal gender = userSnapshot.data.get(UserFields.gender); // gender: Gender (automatically converted!)\nswitch (gender) {\n  case Gender.male:\n    ......\n}\n\n// Access sub collection\nfinal friendsReference = userReference.SubCollection(UserChildren.friends);\n```\n\n### Using sub collection reference\n\n```dart\nfinal usersReference = Stove.instance.collection\u003cUser\u003e(\"/users\");\n\n// Get all documents\nfinal snapshots = usersReference.documents();\n\n// Listen all documents\nusersReference.snapshots()\n  .listen((/*List\u003cDocumentSnapshot\u003cUser\u003e\u003e*/ snapshots) {\n    doYourStuff(snapshots)\n});\n\n// Query documents\nusersReference\n  .where(UserFields.gender, isEqualTo: Gender.female)\n  .order(UserFields.name$)\n  .documents();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikuchy%2Fstove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikuchy%2Fstove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikuchy%2Fstove/lists"}