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

example/lib/main.dart

import 'package:disable_web_context_menu/disable_web_context_menu.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(),
      home: const MyHomePage(),
    );
  }
}

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 disables the native context menu 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