super_context_menu 0.6.0 copy "super_context_menu: ^0.6.0" to clipboard
super_context_menu: ^0.6.0 copied to clipboard

Context menu for Flutter that can seamlesly transition to drag & drop on mobile. Uses system context menu on iOS, macOS and Linux.

Context Menu for Flutter #

Features #

  • Single context menu widget that works accross all desktop platforms, mobile platforms and web

  • Can transition to native drag & drop on Android & iOS

1-mobile

  • Native context menu on iOS, macOS and Linux
  • Flutter context menu on Android, Windows and Web

2-desktop

  • Advanced features such as custom lift image, menu and drag preview, deferred menu items (lazy loading) and deferred menu preview

3-mobile

Getting started #

super_context_menu uses Rust internally to implement low-level platform specific functionality. Rather than shipping prebuilt binaries with the plugin, Rust build is seamlessly integrated into the Flutter build process.

To use super_context_menu, you will need to install Rust:

For macOS or Linux, execute the following command in Terminal.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

For Windows, you can use the Rust Installer.

In case you have Rust already installed, make sure to update it to latest version:

rustup update

That is it. The build integration will automatically install required Rust targets and other dependencies (NDK). This also means that first build might take a little bit longer.

Usage #

Basic example:

  return ContextMenuWidget(
    child: const Item(
    child: Text('Base Context Menu'),
    ),
    menuProvider: (_) {
    return Menu(
        children: [
        MenuAction(title: 'Menu Item 2', callback: () {}),
        MenuAction(title: 'Menu Item 3', callback: () {}),
        MenuSeparator(),
        Menu(title: 'Submenu', children: [
            MenuAction(title: 'Submenu Item 1', callback: () {}),
            MenuAction(title: 'Submenu Item 2', callback: () {}),
            Menu(title: 'Nested Submenu', children: [
            MenuAction(title: 'Submenu Item 1', callback: () {}),
            MenuAction(title: 'Submenu Item 2', callback: () {}),
            ]),
        ]),
        ],
    );
    },
);

Running the example project #

Example project is available at super_context_menu/example.

flutter pub global activate melos # if you don't have melos already installed
git clone https://github.com/superlistapp/super_native_extensions.git
cd super_native_extensions
melos bootstrap

After this you can open the folder in VSCode and run the super_context_menu_example launcher configuration.

176
likes
0
pub points
93%
popularity

Publisher

verified publishernativeshell.dev

Context menu for Flutter that can seamlesly transition to drag & drop on mobile. Uses system context menu on iOS, macOS and Linux.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, device_info_plus, flutter, pixel_snap, super_native_extensions

More

Packages that depend on super_context_menu