flutter_overlay_window
flutter_overlay_window copied to clipboard
Wrong size when switching between portrait and landscape mode.
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.
Having same issue, I've tried multiple solutions but no lucks
you can try my fork:https://github.com/gitbobobo/flutter_overlay_window/tree/adaptive
the problem is it is outdated