adaptive_sheet 1.0.0 copy "adaptive_sheet: ^1.0.0" to clipboard
adaptive_sheet: ^1.0.0 copied to clipboard

A zero-boilerplate, responsive Cupertino bottom sheet kit for Flutter. Trigger native-feeling sheets with a clean header, drag physics, keyboard handling, and adaptive tablet presentation in a single call.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'screens/home_screen.dart';

/// App-wide notification of the selected [ThemeMode].
///
/// The theme customizer example writes to this notifier and the root widgets
/// rebuild live, proving that a sheet can mutate the app behind it.
final ValueNotifier<ThemeMode> exampleThemeMode =
    ValueNotifier<ThemeMode>(ThemeMode.system);

/// App-wide notification of the selected accent color (the Material seed).
final ValueNotifier<Color> exampleAccentColor =
    ValueNotifier<Color>(const Color(0xFF4F46E5));

/// Entry point for the adaptive_sheet example application.
void main() {
  runApp(const AdaptiveSheetExampleApp());
}

/// Root widget of the example application.
///
/// A Material app so the sheets can be exercised on Material surfaces, even
/// though the sheets themselves follow the Cupertino design language.
class AdaptiveSheetExampleApp extends StatelessWidget {
  /// Creates the example application.
  const AdaptiveSheetExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: Listenable.merge(<Listenable>[
        exampleThemeMode,
        exampleAccentColor,
      ]),
      builder: (BuildContext context, Widget? child) {
        final Color seed = exampleAccentColor.value;
        return MaterialApp(
          title: 'adaptive_sheet',
          debugShowCheckedModeBanner: false,
          themeMode: exampleThemeMode.value,
          theme: ThemeData(
            useMaterial3: true,
            colorScheme: ColorScheme.fromSeed(
              seedColor: seed,
              brightness: Brightness.light,
            ),
          ),
          darkTheme: ThemeData(
            useMaterial3: true,
            colorScheme: ColorScheme.fromSeed(
              seedColor: seed,
              brightness: Brightness.dark,
            ),
          ),
          home: const HomeScreen(),
        );
      },
    );
  }
}
0
likes
150
points
88
downloads

Documentation

API reference

Publisher

verified publishereebrahimjoy.com

Weekly Downloads

A zero-boilerplate, responsive Cupertino bottom sheet kit for Flutter. Trigger native-feeling sheets with a clean header, drag physics, keyboard handling, and adaptive tablet presentation in a single call.

Repository (GitHub)
View/report issues

Topics

#bottom-sheet #cupertino #modal #sheet #responsive

License

MIT (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on adaptive_sheet