foldable_device
1.0.5, released 2 weeks ago by an unverified publisher
Foldable posture, hinge angle, and reserved screen regions for Android foldables and the iPhone Duo.
What it does
Provides fold posture, hinge angle, fold direction, and reserved screen regions like cameras and status pills for Android foldables and the iPhone Duo. Delivers data over an EventChannel and includes utility widgets like FoldSafeArea to keep content clear of hardware obstructions.
AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building adaptive layouts for Android foldables and the iPhone Duo
- Handling hinge angles, postures, and active folds in Flutter applications
- Keeping content clear of cameras, status pills, and screen folds using custom safety widgets
Skip it when
- Targeting platforms other than Android and iOS 27.1+
- You only need basic responsive breakpoints without hardware foldable awareness
Strengths
- Supports both Android foldables and iOS 27.1+ iPhone Duo devices
- Provides dedicated widgets like FoldSafeArea for padding content away from hardware cutouts
- Tracks hinge angles, posturing, and active occlusion regions
Weaknesses
- Requires minimum iOS 15.0 and Xcode 27.1+ for iOS features
- Flutter's own built-in iOS engine does not automatically populate MediaQuery.displayFeatures
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Requires calling FoldableHelper.initialize() in main(), placing FoldableScope above MaterialApp, and forcing iOS deployment target to 15.0 in Podfile if necessary.
import 'package:flutter/material.dart';
import 'package:foldable_device/foldable_device.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
FoldableHelper.initialize();
runApp(FoldableScope(
child: const MaterialApp(home: HomeScreen()),
));
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
FoldableScope.watch(context);
if (FoldableHelper.isFoldActive) {
return const Text('two panes, one per side of the fold');
}
return const Text('one continuous layout');
}
}Alternatives
Packages that do the same job and could replace foldable_device.
- foldable
iPhone Duo hinge angle, fold posture and fold/camera regions for Flutter.
71Compare - duo_kit
Flutter widgets to layout content around a foldable device’s hinge and strip
78Compare - iphone_duo_ui_pro
Fold-aware Flutter widgets and layouts for iPhone Duo devices.
66Compare - dual_screen
Foldable and dual-screen support with the TwoPane widget and hinge angle sensor data.
30Compare