mac_menu_bar 0.0.1
mac_menu_bar: ^0.0.1 copied to clipboard
A Flutter plugin that provides access to macOS menu bar actions, allowing Flutter applications to handle standard menu items like Cut, Copy, Paste, and Select All with custom behavior.
import 'package:flutter/material.dart';
import 'package:mac_menu_bar/mac_menu_bar.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
MacMenuBar.onPaste(() async {
debugPrint('Paste menu item selected');
return true;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: Center(child: TextField()),
),
);
}
}