Skip to main content

ap_drawer 0.1.0 copy "ap_drawer: ^0.1.0" to clipboard
ap_drawer: ^0.1.0 copied to clipboard

Animated side drawer for Flutter with 14 transitions, a ready-made app shell, theming, RTL layouts and web support.

example/lib/main.dart

import 'package:ap_drawer/ap_drawer.dart';
import 'package:material_ui/material_ui.dart';

import 'pages/home_page.dart';
import 'showcase_controller.dart';

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

/// Root widget of the ap_drawer showcase.
class ShowcaseApp extends StatefulWidget {
  /// Creates the showcase app.
  const ShowcaseApp({super.key});

  @override
  State<ShowcaseApp> createState() => _ShowcaseAppState();
}

class _ShowcaseAppState extends State<ShowcaseApp> {
  final ShowcaseController _controller = ShowcaseController();

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return ShowcaseScope(
      controller: _controller,
      child: Builder(
        builder: (context) {
          final c = ShowcaseScope.of(context);
          final theme = c.drawerTheme;
          return MaterialApp(
            title: 'ap_drawer showcase',
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              useMaterial3: true,
              colorScheme: ColorScheme.fromSeed(
                seedColor: theme.primaryColor,
                brightness: c.dark ? Brightness.dark : Brightness.light,
              ),
            ),
            // The bridge installs its own Localizations, which resets the text
            // direction to the locale's. Keep Directionality *inside* it.
            builder: (context, child) => MaterialUiCompatibilityBridge(
              child: ApDrawerThemeScope(
                theme: theme,
                child: Directionality(
                  textDirection: c.rtl ? TextDirection.rtl : TextDirection.ltr,
                  child: child!,
                ),
              ),
            ),
            home: const HomePage(),
          );
        },
      ),
    );
  }
}
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Animated side drawer for Flutter with 14 transitions, a ready-made app shell, theming, RTL layouts and web support.

Repository (GitHub)
View/report issues

Topics

#drawer #navigation #side-menu #animation #flutter

License

MIT (license)

Dependencies

curved_navigation_bar_pro, flutter, material_ui

More

Packages that depend on ap_drawer