dual_screen
1.0.4, released 4 years ago by microsoft.com
Foldable and dual-screen support with the TwoPane widget and hinge angle sensor data.
What it does
Provides the TwoPane layout widget for handling foldables and dual screens, and access to hinge angle sensor data via DualScreenInfo. It adapts layouts based on display features like hinges automatically.
AI-written summary of version 1.0.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building apps optimized for foldable devices or dual-screen hardware like the Surface Duo
- Implementing side-by-side or top-and-bottom pane layouts that snap to hinges
- Reading real-time hinge angle sensor data
Skip it when
- Targeting strictly traditional single-screen non-foldable devices
- Needing complex state management or navigation solutions
Strengths
- Simplifies dual-screen and foldable layouts with TwoPane
- Provides direct access to hinge angle sensor events
- Integrates seamlessly with MediaQuery display features
Weaknesses
- Only fully utilized on devices with actual hardware hinges or foldable screens
- Limited to specific dual-screen and foldable form factors
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dual_screen as a dependency in pubspec.yaml and import 'package:dual_screen/dual_screen.dart'.
Widget build(BuildContext context) {
return TwoPane(
startPane: _widgetA(),
endPane: _widgetB(),
paneProportion: 0.3,
panePriority: MediaQuery.of(context).size.width > 500 ? TwoPanePriority.both : TwoPanePriority.pane1,
);
}Alternatives
Packages that do the same job and could replace dual_screen.
- foldable_device
Foldable posture, hinge angle, and reserved screen regions for Android foldables and the iPhone Duo.
64Compare - duo_kit
Flutter widgets to layout content around a foldable device’s hinge and strip
78Compare - foldable
iPhone Duo hinge angle, fold posture and fold/camera regions for Flutter.
71Compare