{"id":32302315,"url":"https://github.com/extremevn/esizer","last_synced_at":"2025-10-23T05:56:52.336Z","repository":{"id":56828551,"uuid":"459116612","full_name":"extremevn/esizer","owner":"extremevn","description":"A Flutter package provide responsive, dynamic, configurable size for each device screen size.","archived":false,"fork":false,"pushed_at":"2022-02-15T06:28:04.000Z","size":752,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T05:56:45.639Z","etag":null,"topics":["dimensions","responsive","responsive-layout","screen","screensize","size"],"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/extremevn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-14T10:32:48.000Z","updated_at":"2022-02-15T01:49:19.000Z","dependencies_parsed_at":"2022-08-29T02:41:12.008Z","dependency_job_id":null,"html_url":"https://github.com/extremevn/esizer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/extremevn/esizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremevn%2Fesizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremevn%2Fesizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremevn%2Fesizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremevn%2Fesizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extremevn","download_url":"https://codeload.github.com/extremevn/esizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremevn%2Fesizer/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":["dimensions","responsive","responsive-layout","screen","screensize","size"],"created_at":"2025-10-23T05:56:43.392Z","updated_at":"2025-10-23T05:56:52.331Z","avatar_url":"https://github.com/extremevn.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESizer\n\nA Flutter package provide responsive, dynamic, configurable size for each device screen size.\n\n## Features\n\n- Responsive, adaptive size\n- Dynamic load size data from predefined files from assets\n\n\u003ctable\u003e\n  \u003ctr\u003e\n      \u003ctd\u003e\n        \u003cimg src=\"./screen_capture/responsive_tablet_sample.png\"\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n        \u003cimg src=\"./screen_capture/responsive_phone_sample.png\" \u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n \u003c/table\u003e\n \nWithout using this packages: \n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"./screen_capture/no_responsive_tablet_sample.png\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n \u003c/table\u003e\n \n## Getting Started\n\nThis package is use to develop app which use Bloc pattern clearer, quicker, easier by wrapping\ncomplicated bloc usage.\n\n## Usage\n\n### Create size resource data file and add to pubspec\n\n- Create size resource data files (currently support only yaml format)  in default folder : \"\n  assets/dimens\". For example:\n\n```yaml\nhomeScreen:\n  contentPadding: 10\n  iconSize: 50\n  titleTextSize: 24\n  descriptionTextSize: 16\n  widgetSpaceSize: 16\n```\n\n- Add assets folder path to pubspec.yaml file:\n\n```yaml\nflutter:\n  # ... \n  assets:\n    - assets/dimens/\n```\n\n### Config and use in application\n\n- Make sure `WidgetsFlutterBinding.ensureInitialized();` main function before application start:\n\n```dart\nFuture\u003cvoid\u003e main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n  runApp(const MyApp());\n}\n```\n\n### Using widget\n\n```dart\nESizer(\n  builder: (BuildContext context) {\n    return const ResponsiveHomePage();\n  },\n  sizeFileResolver: ({BoxConstraints? boxConstraints, Orientation? orientation}) =\u003e \"phone.yaml\",\n)\n```\n\nAbove code for `sizeFileResolver` function use very simple logic: return name of resource file. You\ncan also add more logic to specify how to choose which size data files to load in.\n\nFor example: load 'phone.yaml' or 'table.yaml' depend on width and orientation of device\n\n```dart\n  String _resolveSizeDataFile({BoxConstraints? boxConstraints, Orientation? orientation}) {\n  if (boxConstraints != null) {\n    if (Platform.isAndroid || Platform.isIOS) {\n      if (orientation == Orientation.portrait) {\n        if (boxConstraints.maxWidth \u003c 600) {\n          return \"phone.yaml\";\n        } else {\n          return \"tablet.yaml\";\n        }\n      } else if (orientation == Orientation.landscape) {\n        if (boxConstraints.maxHeight \u003c 600) {\n          return \"phone.yaml\";\n        } else {\n          return \"tablet.yaml\";\n        }\n      } else {\n        return \"phone.yaml\";\n      }\n    } else {\n      return \"phone.yaml\";\n    }\n  }\n  return \"phone.yaml\";\n}\n```\n\n# Code generation for size data\n\nBy using command 'esizer:generate' you can generate dart code for more convenient\n\n```shell\nflutter pub run esizer:generate -I assets/dimens -o dimen_keys.g.dart -n DimenKeys \n```\n\nThen we have class like:\n\n```dart\nabstract class DimenKeys {\n  static const homeScreenIconSize = 'homeScreen.icon_size';\n  static const homeScreenTitleTextSize = 'homeScreen.titleTextSize';\n  static const homeScreenDescriptionTextSize = 'homeScreen.descriptionTextSize';\n  static const homeScreenWidgetSpaceSize = 'homeScreen.widgetSpaceSize';\n  static const homeScreenContentPadding = 'homeScreen.contentPadding';\n}\n```\n\nAfter that, in any where in application we use it as bellow:\n\n```dart\nContainer (\n  padding:EdgeInsets.all(DimenKeys.homeScreen_content_padding.sw),\n  color: Colors.white)\n```\n\n## Issues and feedback\nCreate issues and add appropriate label on Github issues or into our [mailing list]\nFor more detail see [CONTRIBUTING](CONTRIBUTING.md)\n\n## Contributor\n\n- [Justin Lewis](https://github.com/justin-lewis) (Maintainer)\n- [dung95bk](https://github.com/dung95bk) (Developer)\n\n## License\n\n[MIT](LICENSE)\n\n[mailing list]: https://groups.google.com/g/esizer_group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremevn%2Fesizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextremevn%2Fesizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremevn%2Fesizer/lists"}