{"id":17168397,"url":"https://github.com/apalala-dev/fit_or_scale","last_synced_at":"2025-07-17T04:33:03.588Z","repository":{"id":57699203,"uuid":"500739128","full_name":"apalala-dev/fit_or_scale","owner":"apalala-dev","description":"Wrap your widget with FitOrScale to make them scale down when their available space is below a given minWidth and/or minHeight.","archived":false,"fork":false,"pushed_at":"2022-06-08T11:18:05.000Z","size":5095,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T08:24:11.391Z","etag":null,"topics":[],"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/apalala-dev.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":"2022-06-07T07:42:12.000Z","updated_at":"2022-06-07T08:02:16.000Z","dependencies_parsed_at":"2022-09-26T21:12:14.756Z","dependency_job_id":null,"html_url":"https://github.com/apalala-dev/fit_or_scale","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/apalala-dev%2Ffit_or_scale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apalala-dev%2Ffit_or_scale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apalala-dev%2Ffit_or_scale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apalala-dev%2Ffit_or_scale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apalala-dev","download_url":"https://codeload.github.com/apalala-dev/fit_or_scale/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245330070,"owners_count":20597713,"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":[],"created_at":"2024-10-14T23:11:50.695Z","updated_at":"2025-03-24T18:40:46.395Z","avatar_url":"https://github.com/apalala-dev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Discouraged\n\nThis package was an attempt to solve a problem that was already solved by the `FittedBox` widget.\nJust use `FittedBox` instead:\n\n``` dart\nFittedBox(\n    fit: BoxFit.scaleDown,\n    child: // widget to auto scale\n)\n```\n\n## Original description\n\nWrap your widgets with `FitOrScale` to make them scale down if their available space is below a `minWidth` and/or a `minHeight`.\n\n\nThis might help with responsive design in situations where you don't want to remove elements but you encounter overflow issues if you don't.\n\nThis should probably be used for specific scenarios such as very small screen. In other cases, you should probably just provide a less detailed version of your widget (use an overflow menu instead of displaying several icons for instance).\n\n![Example demo](media/example_demo.gif)\n\nNote how the text  and the icons scale down instead of being cut / having overflow issues when the screen size become too small.\n\n## Usage\n\n```dart\nFitOrScale(\n    // Scale down when you reach minWidth\n    minWidth: 418,\n    // Scale down when you reach minHeight\n    minHeight: 170,\n    // Help define the minWidth and minHeight values by showing current dimensions of your child. It\n    // is not shown in release mode\n    showSizeOverlay: false,\n    // Alignment of the scaled down child, when it is scaled down\n    alignment: Alignment.center,\n    // Your widget\n    child: YourWidget(),\n)\n```\n\n**Note:** FitOrScale must have constrained width and height. You can use `Flexible` or `Expanded` in `Column` or `Row` for instance, or a `SizedBox`, `ConstrainedBox`, `Container` or similar for a more fixed size.\n\n## Feedback\n\nIf you have any feedback, issue or ideas for this package, feel free to fill an issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapalala-dev%2Ffit_or_scale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapalala-dev%2Ffit_or_scale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapalala-dev%2Ffit_or_scale/lists"}