feat: add keyboard shortcuts for notes, the note list and the app
This commit is contained in:
parent
ed2de5e67f
commit
722390ecec
9 changed files with 532 additions and 60 deletions
|
|
@ -7,6 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
|
|||
import 'themes/day.dart';
|
||||
import 'themes/night.dart';
|
||||
import 'note_list.dart';
|
||||
import 'shortcuts.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
|
@ -72,6 +73,15 @@ class _MuzzleVelocityAppState extends State<MuzzleVelocityApp> {
|
|||
textTheme: GoogleFonts.ibmPlexMonoTextTheme(nightText),
|
||||
),
|
||||
themeMode: _themeMode,
|
||||
// App-wide shortcuts; screens can override them with their own bindings.
|
||||
builder: (context, child) => CallbackShortcuts(
|
||||
bindings: {
|
||||
quitShortcut: quitApp,
|
||||
primaryShortcut(LogicalKeyboardKey.keyD): () =>
|
||||
_toggleTheme(_themeMode != ThemeMode.dark),
|
||||
},
|
||||
child: child!,
|
||||
),
|
||||
home: NoteListScreen(
|
||||
toggleTheme: _toggleTheme,
|
||||
toggleTags: _toggleTags,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue