{"id":27702521,"url":"https://github.com/ivnsch/dart_copy_with_plugin","last_synced_at":"2026-03-02T00:31:40.569Z","repository":{"id":151087375,"uuid":"174869631","full_name":"ivnsch/dart_copy_with_plugin","owner":"ivnsch","description":"Dart copyWith generation plugin","archived":false,"fork":false,"pushed_at":"2019-04-10T21:29:56.000Z","size":290,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-19T16:56:47.320Z","etag":null,"topics":["android-studio-plugin","dart","intellij-plugin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/ivnsch.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-10T19:19:36.000Z","updated_at":"2023-01-02T15:58:42.000Z","dependencies_parsed_at":"2023-04-14T18:33:24.483Z","dependency_job_id":null,"html_url":"https://github.com/ivnsch/dart_copy_with_plugin","commit_stats":null,"previous_names":["owlmafia/dart_copy_with_plugin","ivnsch/dart_copy_with_plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ivnsch/dart_copy_with_plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivnsch%2Fdart_copy_with_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivnsch%2Fdart_copy_with_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivnsch%2Fdart_copy_with_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivnsch%2Fdart_copy_with_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivnsch","download_url":"https://codeload.github.com/ivnsch/dart_copy_with_plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivnsch%2Fdart_copy_with_plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29988040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: 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":["android-studio-plugin","dart","intellij-plugin"],"created_at":"2025-04-25T20:59:17.815Z","updated_at":"2026-03-02T00:31:40.539Z","avatar_url":"https://github.com/ivnsch.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart copyWith plugin\n\nGenerates a `copyWith` implementation for Dart classes in IntelliJ / Android Studio.\n\nInstructions:\n\n- Position the cursor where you want to insert the  `copyWith` method.\n\n- Press CMD+N / CTRL+N to show the generate dialog (Alternatively, right click in the editor and select \"Generate...\")\n\n![ScreenShot](img/screenshot.png)\n\n- Select the \"copyWith\" menu item.\n\n### Example:\n\nGiven the class:\n\n```dart\nclass Book {\n    final String id;\n    final String name;\n    final String description;\n    final Author author;\n    \n    // ... methods ...\n}\n```\n\nThe plugin will generate the following `copyWith` method:\n\n```dart\nBook copyWith({String id, String name, String description, Author author}) {\n    return Book(\n        id: id ?? this.id,\n        name: name ?? this.name,\n        description: description ?? this.description,\n        author: author ?? this.author,\n    );\n}\n```\n\n### Current limitations:\n\nMost of these are not an issue if you're following Dart's coding conventions. Mentioned for completeness:\n\n- The fields have to be listed directly below the class declaration (new lines are allowed). So for example, if you have field declarations below method declarations, they will not be included.\n- Only one field per line! This, for example, will not be parsed: `final String foo; final String bar;`\n- Fields with a default value will not be included. E.g. `String foo = \"hello\"`.\n- If there are multiple classes per file, it works only for the first one.\n\n### Contribute:\n\n- The logic to generate the method string is in [CopyWithMethodGenerator.kt](https://github.com/i-schuetz/dart_copy_with_plugin/blob/master/src/main/kotlin/action/CopyWithMethodGenerator.kt). You don't need any plugin knowledge to modify its behavior. To contribute:\n1. Fork\n2. Commit changes to a branch in your fork\n3. Push your code and make a pull request\n    \nAdding some unit tests for [CopyWithMethodGenerator.kt](https://github.com/i-schuetz/dart_copy_with_plugin/blob/master/src/main/kotlin/action/CopyWithMethodGenerator.kt) would be great, in particular to be able to test without having to touch anything plugin related.\n\n### Outlook:\n\nThe parsing definitely could be smarter, to generate something similar to an AST, perhaps. For now the parsing is very simple and regex based. This is probably enough for this small plugin though.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivnsch%2Fdart_copy_with_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivnsch%2Fdart_copy_with_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivnsch%2Fdart_copy_with_plugin/lists"}