disable_web_context_menu 1.0.0+2 copy "disable_web_context_menu: ^1.0.0+2" to clipboard
disable_web_context_menu: ^1.0.0+2 copied to clipboard

Disables the web context menu for a given widget

DisableWebContextMenu #

A Flutter widget that disables the native context menu on web for the child widget.

Read the blog post about it here

You can test it live here

Usage #

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: DisableWebContextMenu(
          child: Container(
            width: 200,
            height: 200,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              border: Border.all(),
              borderRadius: BorderRadius.all(Radius.circular(16)),
            ),
            child: Text(
              'This container has the native context menu disabled on right click',
              textAlign: TextAlign.center,
            ),
          ),
        ),
      ),
    );
  }
}
4
likes
150
points
0
downloads

Publisher

verified publishermariuti.com

Weekly Downloads

Disables the web context menu for a given widget

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on disable_web_context_menu