Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scaling up #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Pourianof
Copy link

@Pourianof Pourianof commented Nov 28, 2024

Hi, i added a feature which make it possible to designers to work based on certain device size and then scale that render up to current device size if it is larger.
I felt for need and came across this feature when i was working on a Figma template which was designed based on 1540px screen width, and i needed to match my sizes like fonts, column widths, aspect ratios and other stuff with that design and so i first used ResponsiveScaleBox with width 1540 but then i wanted to scale it up to my screen size without any empty borders. So by this feature, i could design based on the figma sizes and then scale up to my screen size.
I hope I made my point clear, i'm not native English speaker

@Pourianof Pourianof changed the title add scaling up the responsive box to fill available space Add scaling up Nov 28, 2024
@@ -40,7 +44,7 @@ class ResponsiveScaledBox extends StatelessWidget {
padding: scaledViewPadding, insets: scaledViewInsets);

Widget childHolder = FittedBox(
fit: BoxFit.fitWidth,
fit: BoxFit.cover,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't change this for everyone.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed and return that back to Boxfit.fitWidth, actually in my tests it doesn't make any difference to output result because of respecting to aspect ratio.

@rayliverified
Copy link
Contributor

Thanks @Coded-By-Pouria , I think this is interesting.

There should be a way to do this with the existing API without making a change? Can you wrap the widget with a Transform.scale?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants