{"id":24957116,"url":"https://github.com/kernelpanic92/old_dartstruct","last_synced_at":"2025-04-10T19:12:38.124Z","repository":{"id":41885506,"uuid":"257366423","full_name":"KernelPanic92/old_dartstruct","owner":"KernelPanic92","description":"An annotation processor inspired by mapstruct for generating type-safe mappers","archived":false,"fork":false,"pushed_at":"2024-12-21T05:37:48.000Z","size":34,"stargazers_count":5,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:54:37.024Z","etag":null,"topics":["annotation-processor","build-runner","dart","dartstruct","mapping","mapstruct","object-mapper","source-gen"],"latest_commit_sha":null,"homepage":null,"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/KernelPanic92.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-04-20T18:13:53.000Z","updated_at":"2023-11-08T05:38:08.000Z","dependencies_parsed_at":"2023-01-18T11:18:15.012Z","dependency_job_id":null,"html_url":"https://github.com/KernelPanic92/old_dartstruct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelPanic92%2Fold_dartstruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelPanic92%2Fold_dartstruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelPanic92%2Fold_dartstruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelPanic92%2Fold_dartstruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KernelPanic92","download_url":"https://codeload.github.com/KernelPanic92/old_dartstruct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248279975,"owners_count":21077408,"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","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":["annotation-processor","build-runner","dart","dartstruct","mapping","mapstruct","object-mapper","source-gen"],"created_at":"2025-02-03T06:54:35.757Z","updated_at":"2025-04-10T19:12:38.099Z","avatar_url":"https://github.com/KernelPanic92.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dartstruct\nAn annotation processor inspired by mapstruct for generating type-safe mappers\n\n![Dart CI](https://github.com/KernelPanic92/dartstruct/workflows/Dart%20CI/badge.svg)\n\n## What is dartstruct?\n\ndartstruct is a Dart annotation processor, inspired by Java MapStruct, for the generation of type-safe and performant mappers for dart classes. It saves you from writing mapping code by hand, which is a tedious and error-prone task.\n\n\ndartstruct offers the following advantages:\n\n- Fast execution by using plain method invocations\n- Compile-time type safety. Only objects and attributes mapping to each other can be mapped, so there's no accidental mapping.\n- Self-contained code: no runtime dependencies\n- Clear error reports at build time if:\n  - mappings are incomplete (not all target properties are mapped)\n  - mappings are incorrect (cannot find a proper mapping method or type conversion)\n  - Easily debuggable mapping code (or editable by hand—e.g. in case of a bug in the generator)\n\nTo create a mapping between two types, declare a mapper class like this:\n\n```dart\n\n@Mapper()\nabstract class CarMapper {\n\n    static CarMapper get INSTANCE =\u003e CarMapperImpl();\n\n    CarDto carToCarDto(Car car);\n\n}\n\n```\n\nThe generated implementation uses plain Dart method invocations for mapping between source and target objects. Properties are mapped if they have the same name in source and target.\n\n# Using dartstruct\n\nAdd the generator to your dev dependencies\n\n```yaml\n\ndependencies:\n  dartstruct: any\n\ndev_dependencies:\n  dartstruct_generator: any\n  build_runner: any\n\n```\n\nthen run generator\n\n```bash\n\npub run build_runner build  # Dart SDK\nflutter pub run build_runner build # Flutter SDK\n\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelpanic92%2Fold_dartstruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernelpanic92%2Fold_dartstruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelpanic92%2Fold_dartstruct/lists"}