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

A powerful, fully customizable iOS-style context menu: smart positioning, fluid animations, drag-to-select, rich submenus (async, paginated) and your own content above the widget.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:smart_context_menu/smart_context_menu.dart';

import 'core/settings/example_settings.dart';
import 'core/settings/settings_scope.dart';
import 'core/ui/touch_indicator.dart';
import 'pages/tabs/ui/tabs_page.dart';
import 'resources/app_theme/menu_config.dart';

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

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

final class _ExampleAppState extends State<ExampleApp> {
  final _settings = ExampleSettings();

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

  @override
  Widget build(BuildContext context) {
    return SettingsScope(
      settings: _settings,
      child: ListenableBuilder(
        listenable: _settings,
        builder: (context, _) => CupertinoApp(
          title: 'smart_context_menu',
          // The banner covers the settings button in the corner.
          debugShowCheckedModeBanner: false,
          theme: CupertinoThemeData(brightness: _settings.brightness),
          builder: (context, child) => TouchIndicator(
            enabled: _settings.showTouches,
            // One config for all menus of the app.
            child: SmartContextMenuTheme(
              config: _settings.menuConfig(appMenuConfig),
              child: child!,
            ),
          ),
          home: const TabsPage(),
        ),
      ),
    );
  }
}
0
likes
160
points
--
downloads
screenshot

Documentation

API reference

Publisher

verified publisherthenothingworks.dev

A powerful, fully customizable iOS-style context menu: smart positioning, fluid animations, drag-to-select, rich submenus (async, paginated) and your own content above the widget.

Repository (GitHub)
View/report issues

Topics

#context-menu #menu #popup #overlay #cupertino

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on smart_context_menu