{"id":28182763,"url":"https://github.com/yrehim7/user_model_serialization","last_synced_at":"2026-04-28T02:32:25.452Z","repository":{"id":231431159,"uuid":"575771219","full_name":"yrehim7/user_model_serialization","owner":"yrehim7","description":"A lightweight and developer-friendly Dart project that shows how to handle JSON serialization for user models using both automated and manual approaches. Perfect for Flutter and Dart apps that need clean, structured data handling","archived":false,"fork":false,"pushed_at":"2025-04-08T12:36:12.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T01:53:07.799Z","etag":null,"topics":["dart","flutter","json","json-serialization","user-model"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yrehim7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-08T09:03:51.000Z","updated_at":"2025-04-08T12:52:52.000Z","dependencies_parsed_at":"2025-07-18T23:07:58.478Z","dependency_job_id":"89d05710-feb5-4dd9-b4c7-e62156b2f0d0","html_url":"https://github.com/yrehim7/user_model_serialization","commit_stats":null,"previous_names":["yrehim7/json","yrehim7/dart-user-model-json-serialization"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/yrehim7/user_model_serialization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrehim7%2Fuser_model_serialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrehim7%2Fuser_model_serialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrehim7%2Fuser_model_serialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrehim7%2Fuser_model_serialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yrehim7","download_url":"https://codeload.github.com/yrehim7/user_model_serialization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrehim7%2Fuser_model_serialization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32043037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","flutter","json","json-serialization","user-model"],"created_at":"2025-05-16T04:13:37.486Z","updated_at":"2026-04-20T10:32:53.224Z","avatar_url":"https://github.com/yrehim7.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart User Model JSON Serialization\n\nWelcome to the **Dart User Model JSON Serialization** repository!\n\nThis project provides a clean and efficient way to handle JSON serialization and deserialization for user-related data structures in Dart. It features two main components: `user.dart` and `user_model.dart`, each designed for a different level of data abstraction and complexity.\n\n## Files Overview\n\n### `user.dart`\n- Defines a basic `User` class with fields like `name` and `email`.\n- Uses the `json_annotation` package for automatic JSON serialization.\n- Includes:\n  - `fromJson()` factory constructor for parsing from JSON.\n  - `toJson()` method for converting to JSON.\n- This file requires code generation using the `build_runner` tool.\n\n### `user_model.dart`\n- Wraps the `User` class into a more detailed `UserModel`.\n- Adds extra fields like `token`.\n- Manually handles JSON serialization and deserialization logic.\n- Offers helper methods for raw JSON string parsing (`fromRawJson` and `toRawJson`).\n\n##  How to Use\n\n1. **Add Dependencies:**\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  json_annotation: ^4.8.1\n\ndev_dependencies:\n  build_runner: ^2.4.6\n  json_serializable: ^6.6.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrehim7%2Fuser_model_serialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyrehim7%2Fuser_model_serialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrehim7%2Fuser_model_serialization/lists"}