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

Wrong size when switching between portrait and landscape mode. #84

Open
gitbobobo opened this issue Aug 29, 2023 · 2 comments
Open

Wrong size when switching between portrait and landscape mode. #84

gitbobobo opened this issue Aug 29, 2023 · 2 comments

Comments

@gitbobobo
Copy link

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.

@ducviet321
Copy link

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

@gitbobobo
Copy link
Author

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

the problem is it is outdated

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

No branches or pull requests

2 participants