{"id":21902758,"url":"https://github.com/apgapg/flutter_sample_key","last_synced_at":"2025-08-14T08:51:40.981Z","repository":{"id":97735721,"uuid":"195514483","full_name":"apgapg/flutter_sample_key","owner":"apgapg","description":"Medium Article","archived":false,"fork":false,"pushed_at":"2020-05-03T05:08:20.000Z","size":309,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T17:50:15.075Z","etag":null,"topics":["dart","flutter","key","objectkey","uniquekey","valuekey"],"latest_commit_sha":null,"homepage":"https://medium.com/@ayushpguptaapg/using-keys-in-flutter-1c5fb586b2a5","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/apgapg.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}},"created_at":"2019-07-06T08:05:56.000Z","updated_at":"2023-10-09T10:11:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e14ade9f-d57d-4735-b5b1-4b48800c250b","html_url":"https://github.com/apgapg/flutter_sample_key","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apgapg/flutter_sample_key","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fflutter_sample_key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fflutter_sample_key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fflutter_sample_key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fflutter_sample_key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apgapg","download_url":"https://codeload.github.com/apgapg/flutter_sample_key/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fflutter_sample_key/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270391409,"owners_count":24575781,"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-08-14T02:00:10.309Z","response_time":75,"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","key","objectkey","uniquekey","valuekey"],"created_at":"2024-11-28T15:21:03.211Z","updated_at":"2025-08-14T08:51:40.935Z","avatar_url":"https://github.com/apgapg.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_sample_key\n\nA sample on how to use keys in flutter. Full article [here](https://medium.com/@ayushpguptaapg/using-keys-in-flutter-1c5fb586b2a5)\n\n### PROBLEM STATEMENT:\n\nSuppose we have two simple TextFields (wrapped as a stateful widget named MyTextField) in a Column and let’s say you hide the first of two on FAB(Floating Action Button) press. The first one should hide and second one should take its place.\n\n### ITERATION 1: Not using keys:\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/flutter_sample_key/master/screenshot/a1.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n\n### ITERATION 2: Using ValueKey:\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/flutter_sample_key/master/screenshot/a2.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n\n### Experiment: Using UniqueKey:\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/flutter_sample_key/master/screenshot/a3.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapgapg%2Fflutter_sample_key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapgapg%2Fflutter_sample_key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapgapg%2Fflutter_sample_key/lists"}