flutter_overlay_window icon indicating copy to clipboard operation
flutter_overlay_window copied to clipboard

Wrong size when switching between portrait and landscape mode.

Open gitbobobo opened this issue 2 years ago • 2 comments

I've noticed an issue where, after opening a overlay window, its height remains fixed and doesn't change when switching between portrait and landscape modes. However, the width changes when switching between portrait and landscape modes.

return OrientationBuilder(
      builder: (context, orientation) {
        print('orientation: $orientation');
        return LayoutBuilder(
          builder: (context, constraints) {
            print('constraints: $constraints');
            return Container(
              color: Colors.blue.withOpacity(0.3),
              padding: EdgeInsets.only(
                left: 48,
                right: 48,
              ),
              // child: 
            );
          }
        );
      }
    );

here is the log:

I/flutter (29679): orientation: Orientation.portrait
I/flutter (29679): constraints: BoxConstraints(w=392.7, h=913.8)
D/DecorView[](29679): getWindowModeFromSystem  windowmode is 1
D/DecorView[](29679): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (29679): orientation: Orientation.portrait
I/flutter (29679): constraints: BoxConstraints(w=392.7, h=913.8)
I/flutter (29679): orientation: Orientation.portrait
I/flutter (29679): constraints: BoxConstraints(w=872.7, h=913.8)
D/DecorView[](29679): getWindowModeFromSystem  windowmode is 1
D/DecorView[](29679): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (29679): orientation: Orientation.portrait
I/flutter (29679): constraints: BoxConstraints(w=872.7, h=913.8)
I/flutter (29679): orientation: Orientation.portrait
I/flutter (29679): constraints: BoxConstraints(w=392.7, h=913.8)

This issue makes it difficult for me to keep my overlay window component consistently positioned at the top of the screen.

gitbobobo avatar Aug 29 '23 16:08 gitbobobo

Having same issue, I've tried multiple solutions but no lucks

ducviet321 avatar Apr 07 '24 04:04 ducviet321

you can try my fork:https://github.com/gitbobobo/flutter_overlay_window/tree/adaptive

the problem is it is outdated

gitbobobo avatar Apr 09 '24 11:04 gitbobobo