FilledStacks / responsive_builder

A set of widgets to make responsive UI building in flutter more readable
MIT License
497 stars 80 forks source link

Unstable on Windows #31

Closed KKimj closed 1 year ago

KKimj commented 3 years ago

Hello, Thanks your effort for this awesome package! It works perfectly on the web. thanks! I found an unintentional behavior on Windows, When I adjusted the height instead of the width. Please check

         ScreenTypeLayout(
                breakpoints:
                    ScreenBreakpoints(tablet: 773, desktop: 774, watch: 300),
                mobile: Container(
                  color: Colors.blue,
                  child: Center(child: Text('mobile')),
                ),
                // tablet: Container(
                //   color: Colors.yellow,
                //   child: Center(child: Text('tablet')),
                // ),
                desktop: Container(
                  color: Colors.red,
                  child: Center(child: Text('desktop')),
                ),
                watch: Container(
                  color: Colors.purple,
                  child: Center(child: Text('watch')),
                ),
              ),

Normal screen1 ( mobile size )

image

Unintentional screen2 ( just adjust height of screen1 )

image

Thanks!!

disparta commented 3 years ago

@KKimj Have you found a solution for this? I'm having a similar issue on mac.

Screenshot 2021-07-31 at 13 36 43

@FilledStacks is there a fix on the way for this?

georgeherby commented 2 years ago

I have found the issue.

https://github.com/FilledStacks/responsive_builder/blame/master/lib/src/widget_builders.dart#L35 this line has a function with a default parameter that is set to kIsWeb. So the behaviour only works for web. Unfortunately from the ResponsiveBuilder does now have any way of passing on an override to the underlying function within getRefinedSize. It is also worth noting that the getDeviceType method does not take the override variable isWebOrDesktop but uses the same internal logic that impacts the logic too.

I will have a look and raise a PR

georgeherby commented 2 years ago

@disparta @KKimj I have fixed this in the PR mentioned above (details are in the MR for how to use) to use the fork I the meantime

responsive_builder:
    git:
      url: git://github.com/georgeherby/responsive_builder.git
      ref: master
DirtyNative commented 1 year ago

Any news on this issue?

FilledStacks commented 1 year ago

I have not looked at this. I'm adding it too my list to fix up. Will report back soon.