ResponsiveFramework icon indicating copy to clipboard operation
ResponsiveFramework copied to clipboard

Version 0.3.0 Design Considerations

Open jlnrrg opened this issue 3 years ago • 5 comments

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.

jlnrrg avatar Nov 21 '21 12:11 jlnrrg

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.)

jlnrrg avatar Nov 21 '21 12:11 jlnrrg

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 of strings
  • [ ] breakpoint ranges for more understandable sizing behavior
  • [ ] decoupling of sizing behavior from breakpoints, by using defaultBehavior and customPlatformBehavior

jlnrrg avatar Nov 21 '21 12:11 jlnrrg

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.

rayliverified avatar Nov 21 '21 18:11 rayliverified

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]);

rayliverified avatar Nov 21 '21 18:11 rayliverified

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

jlnrrg avatar Nov 21 '21 19:11 jlnrrg