Skip to main content

foldable_device 0.1.1 copy "foldable_device: ^0.1.1" to clipboard
foldable_device: ^0.1.1 copied to clipboard

Foldable posture, hinge angle, fold direction and reserved regions (fold, camera) for Android foldables and the iPhone Duo (iOS 27.1+).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:foldable_device/foldable_device.dart';

import 'home_screen.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  // Start listening to the native hinge events (Android foldables, iPhone Duo).
  FoldableHelper.initialize();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    // FoldableScope above the whole app: any widget that calls
    // FoldableScope.watch(context) rebuilds on every fold/hinge change.
    return FoldableScope(
      child: const MaterialApp(
        home: HomeScreen(),
      ),
    );
  }
}
16
likes
160
points
103
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Foldable posture, hinge angle, fold direction and reserved regions (fold, camera) for Android foldables and the iPhone Duo (iOS 27.1+).

Repository (GitHub)
View/report issues

Topics

#foldable #hinge #dual-screen #iphone #layout

License

MIT (license)

Dependencies

flutter

More

Packages that depend on foldable_device

Packages that implement foldable_device