ResponsiveFramework
ResponsiveFramework copied to clipboard
Version 0.3.0 Design Considerations
As noted in #33 there are a few things that would be great to be considered for a version 0.3.0.
This issue should function to spark a discussion between @searchy2 and the community, which things could be improved.
As there are way more intelligent people than me, I'd like to invite them to voice their ideas, too. Especially named here are: @rydmike (creator of Flexfold), @ResoCoder (created the video tutorial)
(Feel free to tag other people, which you like to voice their opinion, too.)
First Design Proposal for ResponsiveWrapper.builder
:
Create value unions
for specific width ranges (as in #33)
The Constructor then accept these as breakpoints
(without defined behavior), and in a second step a defaultBehavior
can be defined. optional would be ResponsiveTargetPlatform
specific behavior. This would allow for scaling to be allowed on android and ios and disabled on every other.
Summary:
- [ ]
value unions
instead ofstrings
- [ ]
breakpoint ranges
for more understandable sizing behavior - [ ] decoupling of sizing behavior from
breakpoints
, by usingdefaultBehavior
andcustomPlatformBehavior
Context for the original conversation: #33
What do you think about the idea of removing breakpoints and instead have breakpoint segments that allow you to control the behavior instead? For example, instead of setting a breakpoint at 480, you would instead specify the behavior from 480 - 779. I'm considering making this change because it would allow the removal of the complex segments algorithm and simply usage. So instead of having to understand how the library works, developers would be able to specify EXACTLY what happens at each segment. This would also enable support of per platform, per page, and even per widget settings.
I'd love to hear your thoughts and continue this discussion under a new issue.
The syntax for breakpoints would change to something like this:
ResponsiveBreakpoint(start: 0, end: 420, behavior: ResponsiveBehavior.autoscale, platform: [Platform.android, Platform.iOS], tag: "MOBILE_SMALL", orientation: [Orientation.landscape]);
I would argue for something like this:
breakPoints: [ // seperate breakpoints from ResponsiveBehavior logic
ResponsiveBreakpoint(start: 0, end: 420, tag: MOBILE),
ResponsiveBreakpoint(start: 421, end: 700, tag: TABLET),
],
defaultBehavior: <String, ResponsiveBehavior>{
MOBILE: ResponsiveBehavior.autoscale(1, 1.5), // custom define how much the end scale value should be
TABLET: ResponsiveBehavior.resize,
},
iosBehavior: {
MOBILE: ResponsiveBehavior.resize,
TABLET: ResponsiveBehavior.resize,
},
(for simplicity I did not include landscape
features