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

Added more fine tuned controls for different devices #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added more fine tuned controls for different devices #12

wants to merge 1 commit into from

Conversation

razein97
Copy link

More sizes added. Example file also updated to integrate with the new additions. Readme.md not edited.

More sizes added. Example file also updated to integrate with the new additions
@FilledStacks
Copy link
Owner

There are some breaking changes here so I'll move some of the code over and refactor and tag this PR in it.

@razein97
Copy link
Author

Okay. So what do I do now? Close the PR? (Sorry but i'm new to contributing.)

@FilledStacks
Copy link
Owner

@razein97 I keep it open to remind myself I still have to do it. Basically the solution I have in mind should keep the current setup in terms of being able to supply mobile, tablet and desktop at a high level. Similarly to the additional OrientationLayoutBuilder which you can then use to provide your orientation layouts I'm imagining an additional widget builder like RefinedLayoutBuilder.

This should allow you to get much more control as well if you look at it like this.

ScreenTypeLayout.builder(
  mobile: (context) => RefinedLayoutBuilder(
     small: HomeMobileSmall(),
     normal: HomeMobileNormal(),
     large: HomeMobileLarge(),
     extraLarge: HomeMobileExtraLarge()
)

This will make it so that you can use the RefinedLayoutBuilder on it's own if say for instance you're only working on Mobile but you still want to show different layouts for different screen sizes. It will require an additional Enum specifically for small, normal, large, extraLarge as well as a function similar to getValueForScreenType which will allow you to return different values based on the Refined size. This means you can also return specific values per platform and refined size if you nest the calls.

getValueForScreenType<double>(
  context: context,  
  mobile: getValueForRefinedSize<double>( 
     context: context, 
     small: 10,
     normal: 15,
     large: 30,
  ),
);

Hopefully I can get to it today. I'm not making a video this week so I'll be finishing up some things that's been lingering.

@SiyrisSoul
Copy link
Contributor

Any update on this?

@FilledStacks
Copy link
Owner

@TutOsirisOm Not at the moment. My comment above described the implementation i will make if I have time, OP or you can implement that and make a PR?

@SiyrisSoul
Copy link
Contributor

@FilledStacks I'll see what I can do!

@SiyrisSoul
Copy link
Contributor

@FilledStacks How's this look? #19

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.

None yet

3 participants