{"id":32286217,"url":"https://github.com/aswinmurali-io/osum_serializable","last_synced_at":"2025-10-23T01:58:36.587Z","repository":{"id":62459000,"uuid":"538544348","full_name":"aswinmurali-io/osum_serializable","owner":"aswinmurali-io","description":"Serialize almost everything you ever need! 📦 Supports serializing MaterialColor, Color, Size, Locale, IconData, UuidValue, DateTime, Directory, File, Duration, and many more.","archived":false,"fork":false,"pushed_at":"2022-09-21T02:29:40.000Z","size":47,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T01:58:33.072Z","etag":null,"topics":["dart","flutter","json","library","package","serialization"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/osum_serializable","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aswinmurali-io.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":"2022-09-19T14:32:20.000Z","updated_at":"2024-07-13T08:25:39.000Z","dependencies_parsed_at":"2022-11-02T00:45:20.224Z","dependency_job_id":null,"html_url":"https://github.com/aswinmurali-io/osum_serializable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aswinmurali-io/osum_serializable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinmurali-io%2Fosum_serializable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinmurali-io%2Fosum_serializable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinmurali-io%2Fosum_serializable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinmurali-io%2Fosum_serializable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aswinmurali-io","download_url":"https://codeload.github.com/aswinmurali-io/osum_serializable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinmurali-io%2Fosum_serializable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280546412,"owners_count":26348724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"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","library","package","serialization"],"created_at":"2025-10-23T01:58:35.528Z","updated_at":"2025-10-23T01:58:36.573Z","avatar_url":"https://github.com/aswinmurali-io.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# osum_serializable\n\n[![osum_serializable](https://github.com/aswinmurali-io/osum_serializable/actions/workflows/osum_serializable.yaml/badge.svg)](https://github.com/aswinmurali-io/osum_serializable/actions/workflows/osum_serializable.yaml)\n\nThe goal is to serialize almost everything you ever need! `json_serializable` is an amazing package to serialize classes but cannot serialize complex types. This package provides convertors for these types. Check the supported types to know more.\n\n## Supported types\n\n|Type|Support|Type|Support|\n|---|---|---|---|\n|`Color`|✅|`MaterialColor`|✅|\n|`Offset`|✅|`Size`|✅|\n|`Directory`|✅|`File`|✅|\n|`DateTime`|✅|`IconData`|✅|\n|`Duration`|✅|`UuidValue`|✅|\n|`Locale` |✅|\n\n## How it works\n\n|Code|Json|\n|----|----|\n| \u003cimg width=\"350\" src=\"https://user-images.githubusercontent.com/47299190/191183909-945166ce-ebd8-475c-8983-bbfb4a9377f6.png\"/\u003e | \u003cimg width=\"250\" src=\"https://user-images.githubusercontent.com/47299190/191183957-be602b49-187a-4064-9578-d3fdd0cd5c50.png\"/\u003e |\n\n## How to use?\n\n### Install\n\n`osum_serializable` depends on `build_runner` and `json_serializable` to building the `toJson` and `fromJson` implementations. To install run these commands in your terminal.\n\n```bash\nflutter pub add --dev build_runner\nflutter pub add --dev json_serializable\nflutter pub add osum_serializable\n```\n\n### Usage\n\nTo use the convertors, simply postfix the data type name with `Convertor` and call the annotation.\n\n```dart\n@{DATATYPE}Converter()\nfinal {DATATYPE} variable;\n```\n\nFor example, serializing `IconData` can be done like this.\n\n```dart\n@IconDataConverter()\nfinal IconData variable;\n```\n\n### Example\n\nRefer the example section for the full code.\n\n```dart\n// imports ...\npart 'test.g.dart';\n\n@JsonSerializable()\nclass Example {\n  const Example(this.directory, this.file, this.color, this.duration, this.materialColor);\n\n  factory Example.fromJson(Json json) =\u003e _$ExampleFromJson(json);\n\n  @DirectoryConverter() // \u003c- Convertors provided by osum_serializable!\n  final Directory directory;\n\n  @MaterialColorConverter()\n  final MaterialColor materialColor;\n\n  @FileConverter()\n  final File file;\n\n  @ColorConverter()\n  final Color color;\n\n  @DurationConverter()\n  final Duration duration;\n\n  Json toJson() =\u003e _$ExampleToJson(this);\n}\n```\n\nFinally, don't forget to call the `build_runner` to generate the json implementation.\n\n```bash\nflutter pub run build_runner build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faswinmurali-io%2Fosum_serializable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faswinmurali-io%2Fosum_serializable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faswinmurali-io%2Fosum_serializable/lists"}