responsive_builder
responsive_builder copied to clipboard
[FLUTTER WEB] Cannot detect landscape mode on mobile.
I have read the docs about your package. I decided using it for my website. But one thing i wanna know. Is this package can detect phone or tablet screen but in landscape mode. Thank you very much
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: ScreenTypeLayout.builder(
mobile: (BuildContext context) => OrientationLayoutBuilder(
portrait: (context) => Container(color: Colors.green),
landscape: (context) => Container(color: Colors.orange),
),
tablet: (BuildContext context) => Container(color: Colors.yellow),
desktop: (BuildContext context) => Container(color: Colors.red),
watch: (BuildContext context) => Container(color: Colors.purple),
),
);
}
}
I tried this code above but it's not working as my expectation
I think it should be orange
Orientation doesn't use the resolution, it uses the shortest side, which on a real device is updated based on the actual oritentation of the device.
Can you run on a mobile device, swap the orientation and check.
Orientation doesn't use the resolution, it uses the shortest side, which on a real device is updated based on the actual oritentation of the device.
Can you run on a mobile device, swap the orientation and check.
I have run on a real mobile device (Xiaomi k30) and it still doesn't work as my expectation (orange not yellow): This is a BUG on Flutter WEB
https://github.com/FilledStacks/responsive_builder/assets/90593296/63d07e6f-b4c8-4ccc-98c4-010b19ff5a66
Hi @FilledStacks ,any update ?