Skip to content

Commit

Permalink
👒 升级 flutter 和依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
gvenusleo committed Mar 4, 2024
1 parent 51bffb8 commit bcc1416
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 89 deletions.
11 changes: 11 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ update-yarn:
@echo "------------------------------"
@echo "Updating yarn packages......"
@yarn upgrade-interactive --latest

# Install Linux dev dependencies
install-linux-dev:
@echo "------------------------------"
@echo "Installing Linux dev dependencies......"
@sudo apt-get install -y clang cmake \
pkg-config liblzma-dev libgtk-3-dev \
ninja-build libayatana-appindicator3-dev \
keybinder-3.0 libnotify-dev libkeybinder-3.0-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
11 changes: 5 additions & 6 deletions lib/pages/clipboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ class _ClipboardPageState extends State<ClipboardPage> {

@override
Widget build(BuildContext context) {
return RawKeyboardListener(
return KeyboardListener(
focusNode: FocusNode(),
onKey: (RawKeyEvent event) {
if (event is RawKeyDownEvent) {
RawKeyDownEvent rawKeyDownEvent = event;
RawKeyEventData rawKeyEventData = rawKeyDownEvent.data;
switch (rawKeyEventData.logicalKey) {
onKeyEvent: (KeyEvent event) {
if (event is KeyDownEvent) {
KeyDownEvent keyDownEvent = event;
switch (keyDownEvent.logicalKey) {
case LogicalKeyboardKey.arrowUp:
if (_selectedItemIndex > 0) {
setState(() {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ class _HomePageState extends State<HomePage>
{
"keyCode": translationHotKeyList[1],
"modifiers": translationHotKeyList[0].split("-"),
"scope": "system",
},
);
hotKey.scope = HotKeyScope.system;
await hotKeyManager.register(
hotKey,
keyDownHandler: (hotKey) async {
Expand Down
8 changes: 4 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <bitsdojo_window_linux/bitsdojo_window_plugin.h>
#include <clipboard_watcher/clipboard_watcher_plugin.h>
#include <dynamic_color/dynamic_color_plugin.h>
#include <hotkey_manager/hotkey_manager_plugin.h>
#include <hotkey_manager_linux/hotkey_manager_linux_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <local_notifier/local_notifier_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
Expand All @@ -32,9 +32,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) hotkey_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "HotkeyManagerPlugin");
hotkey_manager_plugin_register_with_registrar(hotkey_manager_registrar);
g_autoptr(FlPluginRegistrar) hotkey_manager_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "HotkeyManagerLinuxPlugin");
hotkey_manager_linux_plugin_register_with_registrar(hotkey_manager_linux_registrar);
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
Expand Down
2 changes: 1 addition & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_linux
clipboard_watcher
dynamic_color
hotkey_manager
hotkey_manager_linux
isar_flutter_libs
local_notifier
screen_retriever
Expand Down
Loading

0 comments on commit bcc1416

Please sign in to comment.