{"id":31061766,"url":"https://github.com/dickermoshe/dart_mappable_extras","last_synced_at":"2025-10-11T04:26:25.213Z","repository":{"id":313210109,"uuid":"1050493908","full_name":"dickermoshe/dart_mappable_extras","owner":"dickermoshe","description":"Untagged Unions and Undefined Types for dart_mappable","archived":false,"fork":false,"pushed_at":"2025-09-07T22:29:52.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T21:07:53.811Z","etag":null,"topics":["dart","flutter","json"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dickermoshe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-04T14:05:47.000Z","updated_at":"2025-09-07T22:29:55.000Z","dependencies_parsed_at":"2025-09-04T16:11:37.545Z","dependency_job_id":"9190793e-41f5-4e11-9d33-9f2475241410","html_url":"https://github.com/dickermoshe/dart_mappable_extras","commit_stats":null,"previous_names":["dickermoshe/dart_mappable_extras"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dickermoshe/dart_mappable_extras","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dickermoshe%2Fdart_mappable_extras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dickermoshe%2Fdart_mappable_extras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dickermoshe%2Fdart_mappable_extras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dickermoshe%2Fdart_mappable_extras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dickermoshe","download_url":"https://codeload.github.com/dickermoshe/dart_mappable_extras/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dickermoshe%2Fdart_mappable_extras/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006249,"owners_count":26084061,"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-11T02:00:06.511Z","response_time":55,"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"],"created_at":"2025-09-15T11:39:28.685Z","updated_at":"2025-10-11T04:26:25.174Z","avatar_url":"https://github.com/dickermoshe.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"A small library with some extras for dart_mappable.\n\n# Untagged Unions\n\nThis library allows you to use a union type with dart_mappable.\n```dart\n@MappableClass(includeCustomMappers: unionMappers)\nclass UnionTest2 with UnionTest2Mappable {\n  final Union2\u003cString, int\u003e union;\n  UnionTest2({required this.union});\n}\n\nvoid main() {\n  final unionTest = UnionTest2(union: Union2.in1('test'));\n  final json = unionTest.toMap();\n  expect(json, {'union': 'test'});\n  final unionTest2 = UnionTest2(union: Union2.in2(1));\n  final json2 = unionTest2.toMap();\n  expect(json2, {'union': 1});\n}\n```\n\nWhen deserializing, the mapper will attempt to deserialize the value with each mapper in order until one succeeds. If no mapper succeeds, an Exception is thrown.\n\n# Optional\n\nThis library allows you to use an optional type with dart_mappable.\n```dart\n@MappableClass(includeCustomMappers: [OptionalMapper()], hook: RemoveUndefinedFields([\"optional\", \"optionalNullable\"]))\nclass OptionalTest with OptionalTestMappable {\n  final Optional\u003cString\u003e optional;\n  final Optional\u003cint?\u003e optionalNullable;\n  OptionalTest({required this.optional, required this.optionalNullable});\n}\n\nvoid main() {\n  final optionalTest = OptionalTest(optional: Optional.defined('test'), optionalNullable: Optional.undefined());\n  final json = optionalTest.toMap();\n  expect(json, {'optional': 'test'});\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdickermoshe%2Fdart_mappable_extras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdickermoshe%2Fdart_mappable_extras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdickermoshe%2Fdart_mappable_extras/lists"}