{"id":32302355,"url":"https://github.com/zhang6464/fitter","last_synced_at":"2025-10-23T05:57:35.830Z","repository":{"id":61973261,"uuid":"194820921","full_name":"zhang6464/fitter","owner":"zhang6464","description":"UI Responsive fitting approach according to screent width","archived":false,"fork":false,"pushed_at":"2019-07-09T08:55:14.000Z","size":36,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-23T05:57:14.685Z","etag":null,"topics":["flutter","mediaquery","px2rem"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhang6464.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":"2019-07-02T08:24:20.000Z","updated_at":"2020-12-18T09:54:34.000Z","dependencies_parsed_at":"2022-10-24T13:30:30.411Z","dependency_job_id":null,"html_url":"https://github.com/zhang6464/fitter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zhang6464/fitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhang6464%2Ffitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhang6464%2Ffitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhang6464%2Ffitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhang6464%2Ffitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhang6464","download_url":"https://codeload.github.com/zhang6464/fitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhang6464%2Ffitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280569918,"owners_count":26352860,"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-23T02:00:06.710Z","response_time":142,"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":["flutter","mediaquery","px2rem"],"created_at":"2025-10-23T05:57:31.908Z","updated_at":"2025-10-23T05:57:35.821Z","avatar_url":"https://github.com/zhang6464.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fitter\n**中文** | **[EN](./README_EN.md)**\n\nFlutter项目的多尺寸UI适配方案\n\n## Getting Started\n\n在项目中引入如下代码，可以达到类rem的适配效果：\n\n```\nimport 'package:fitter/fitter.dart';\n\nvoid main() {\n    // maybe your old code here?\n    // runApp(MyApp());\n\n    // and just change your code as below\n    InnerWidgetsFlutterBinding.ensureInitialized()\n      ..attachRootWidget(new MyApp())\n      ..scheduleWarmUpFrame();\n}\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    // another old code maybe\n    // return new MaterialApp(\n\n    // need to replace `MaterialApp` into `CustomMaterialApp` \n    return new CustomMaterialApp(\n      home: new Scaffold(\n        body: Text('Hello World!')\n      ),\n    );\n  }\n}\n```\n默认的设计分辨率为宽度375px，如果想要自定义设计分辨率，那么加一行代码:\n\n```\n...\nvoid main() {\n    // custom design resolution\n    ViewAdapter.screenWidth = 375;\n    \n    InnerWidgetsFlutterBinding.ensureInitialized()\n      ..attachRootWidget(new MyApp())\n      ..scheduleWarmUpFrame();\n}\n...\n```\n## Old Versions\n\n- 如果要支持旧版本flutter SDK, 设置引用的`fitter` 版本号为 `^0.1.0`\n- `fitter` 的 `^1.0.0` 版本依赖 flutter sdk 版本大于等于  `1.2.0`\n\n## Kown Bugs\n\n* `UIKitView` 相关的组件(如`webview` 或 `video`..) 并不能适配尺寸，原因尚未弄清楚...\n* Fitter 1.0+ 版本依赖 `flutter sdk` 1.2+ 版本, 低版本会报错, 如要支持1.2以下版本，请使用 0.1.x版本的 Fitter\n\n## Thanks To\n\n思路来源于 [@genius158](https://github.com/genius158/FlutterTest/blob/master/lib/main.dart) 的文章 [post](https://juejin.im/post/5cb49e306fb9a068a3729b41)。感谢！","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhang6464%2Ffitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhang6464%2Ffitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhang6464%2Ffitter/lists"}