mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-30 04:21:45 +00:00

* fix: border of field cell * chore: add filter button * chore: refactor setting button event * chore: notify row did changed with filter configuration * chore: add filter bloc test * chore: config add filter button * chore: create filter * chore: load filters and update corresponding field property * chore: add filter choice chip * chore: config choice chip ui * chore: send notification when filter updated * chore: update filter after update field type option data * fix: remove/add filter when update field's type option * chore: create home setting bloc to save the setting of the home screen * chore: add filter test * chore: edit text filter ui * fix: filter cell bugs * fix: insert row out of bound * chore: update setting icon in grid * chore: shrink wrap the filter list * refactor: extract row container from row cache * chore: disable split-debuginfo Co-authored-by: nathan <nathan@appflowy.io>
35 lines
1.1 KiB
Dart
35 lines
1.1 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:app_flowy/startup/startup.dart';
|
|
import 'package:app_flowy/workspace/application/home/home_setting_bloc.dart';
|
|
import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hotkey_manager/hotkey_manager.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class HomeHotKeys extends StatelessWidget {
|
|
final Widget child;
|
|
const HomeHotKeys({required this.child, Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
HotKey hotKey = HotKey(
|
|
KeyCode.backslash,
|
|
modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control],
|
|
// Set hotkey scope (default is HotKeyScope.system)
|
|
scope: HotKeyScope.inapp, // Set as inapp-wide hotkey.
|
|
);
|
|
hotKeyManager.register(
|
|
hotKey,
|
|
keyDownHandler: (hotKey) {
|
|
context
|
|
.read<HomeSettingBloc>()
|
|
.add(const HomeSettingEvent.collapseMenu());
|
|
getIt<HomeStackManager>().collapsedNotifier.value =
|
|
!getIt<HomeStackManager>().collapsedNotifier.currentValue!;
|
|
},
|
|
);
|
|
return child;
|
|
}
|
|
}
|