Skip to main content

fold_kit 0.0.1 copy "fold_kit: ^0.0.1" to clipboard
fold_kit: ^0.0.1 copied to clipboard

Foldable and large-screen toolkit for Flutter: fold position, posture, hinge angle and iPhone Duo-style vertical bars.

example/lib/main.dart

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

void main() => runApp(const ExampleApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'fold_kit',
      theme: ThemeData(colorSchemeSeed: const Color(0xFF3F51B5)),
      home: const FoldPage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    final fold = FoldInfo.of(context);
    return Scaffold(
      appBar: AppBar(title: const Text('fold_kit')),
      body: ListView(
        padding: const EdgeInsets.all(24),
        children: [
          _buildRow(
            'Window',
            '${fold.windowSize.width.round()} × '
                '${fold.windowSize.height.round()}',
          ),
          _buildRow('Size class', fold.windowSizeClass.name),
          _buildRow('Posture', fold.posture.name),
          _buildRow('Fold axis', fold.axis?.name ?? '—'),
          _buildRow('Fold rect', fold.rect?.toString() ?? '—'),
        ],
      ),
    );
  }

  Widget _buildRow(String label, String value) {
    return ListTile(title: Text(label), trailing: Text(value));
  }
}
0
likes
160
points
110
downloads

Documentation

API reference

Publisher

verified publishermonsware.com

Weekly Downloads

Foldable and large-screen toolkit for Flutter: fold position, posture, hinge angle and iPhone Duo-style vertical bars.

Homepage
Repository (GitHub)
View/report issues

Topics

#foldable #responsive #layout #iphone-duo #adaptive

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fold_kit

Packages that implement fold_kit