Skip to content

Commit ee96407

Browse files
committed
chore: upgrade dependencies and fix deprecations
Also added dependency_overrides for hotkey_manager_linux to fix compile issues: leanflutter/hotkey_manager#66
1 parent 66fd891 commit ee96407

15 files changed

Lines changed: 306 additions & 222 deletions

lib/apps_list/widgets/custom_app_bar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/foundation.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_bloc/flutter_bloc.dart';
4-
import 'package:flutter_markdown/flutter_markdown.dart';
4+
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
55
import 'package:flutter_typeahead/flutter_typeahead.dart';
66

77
import '../../../settings/cubit/settings_cubit.dart';

lib/apps_list/widgets/first_run_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_markdown/flutter_markdown.dart';
2+
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
33

44
import '../../app/app.dart';
55

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import 'dart:async';
22

3+
import 'package:flutter/services.dart';
34
import 'package:hotkey_manager/hotkey_manager.dart';
45

56
import '../../logs/logs.dart';
67

78
/// The default hotkey to use if none is set.
8-
final HotKey defaultHotkey = HotKey(KeyCode.pause);
9+
final HotKey defaultHotkey = HotKey(key: PhysicalKeyboardKey.pause);
910

1011
/// Handles global (system-wide) hotkeys.
1112
class HotkeyService {
@@ -19,34 +20,22 @@ class HotkeyService {
1920

2021
Future<void> addHotkey(HotKey hotKey) async {
2122
if (hotKeyManager.registeredHotKeyList.contains(hotKey)) {
22-
log.w('Hotkey already registered: ${hotKey.toStringHelper()}');
23+
log.w('Hotkey already registered: ${hotKey.debugName}');
2324
return;
2425
}
2526

2627
await hotKeyManager.register(
2728
hotKey,
2829
keyDownHandler: (hotKey) {
29-
log.i('Hotkey triggered: ${hotKey.toStringHelper()}');
30+
log.i('Hotkey triggered: ${hotKey.debugName}');
3031
_hotkeyTriggeredStreamController.add(hotKey);
3132
},
3233
);
3334

34-
log.i('Registered hotkey: ${hotKey.toStringHelper()}');
35+
log.i('Registered hotkey: ${hotKey.debugName}');
3536
}
3637

3738
Future<void> removeHotkey(HotKey hotkey) async {
3839
await hotKeyManager.unregister(hotkey);
3940
}
4041
}
41-
42-
extension HotKeyHelper on HotKey {
43-
String toStringHelper() {
44-
String hotkeyString = '';
45-
for (var modifier in modifiers ?? <KeyModifier>[]) {
46-
hotkeyString += '${modifier.keyLabel} + ';
47-
}
48-
49-
hotkeyString += keyCode.keyLabel;
50-
return hotkeyString;
51-
}
52-
}

lib/loading/loading_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
3-
import 'package:flutter_markdown/flutter_markdown.dart';
3+
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
44

55
import '../../apps_list/apps_list.dart';
66
import '../app/app.dart';

lib/localization/app_localizations.dart

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -419,30 +419,6 @@ abstract class AppLocalizations {
419419
/// In en, this message translates to:
420420
/// **'Select app'**
421421
String get selectApp;
422-
423-
/// Label for the show window menu item in system tray
424-
///
425-
/// In en, this message translates to:
426-
/// **'Show'**
427-
String get show;
428-
429-
/// Label for the hide window menu item in system tray
430-
///
431-
/// In en, this message translates to:
432-
/// **'Hide'**
433-
String get hide;
434-
435-
/// Label for the reset window menu item in system tray
436-
///
437-
/// In en, this message translates to:
438-
/// **'Reset Window'**
439-
String get resetWindow;
440-
441-
/// Label for the exit menu item in system tray
442-
///
443-
/// In en, this message translates to:
444-
/// **'Exit'**
445-
String get exit;
446422
}
447423

448424
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {

lib/localization/app_localizations_de.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class AppLocalizationsDe extends AppLocalizations {
2323
@override
2424
String get favoriteButtonTooltipRemove => 'Remove from favorites';
2525

26+
@override
27+
String get suspendAllInstances => 'Suspend all instances';
28+
29+
@override
30+
String get resumeAllInstances => 'Resume all instances';
31+
32+
@override
33+
String get close => 'Close';
34+
2635
@override
2736
String get detailsDialogTitle => 'Details';
2837

@@ -38,6 +47,15 @@ class AppLocalizationsDe extends AppLocalizations {
3847
@override
3948
String get detailsDialogCurrentStatus => 'Aktueller Status';
4049

50+
@override
51+
String get statusNormal => 'Normal';
52+
53+
@override
54+
String get statusSuspended => 'Suspended';
55+
56+
@override
57+
String get statusUnknown => 'Unknown';
58+
4159
@override
4260
String get copyLogs => 'Protokolle kopieren';
4361

@@ -121,6 +139,9 @@ class AppLocalizationsDe extends AppLocalizations {
121139
@override
122140
String get logs => 'Protokolle';
123141

142+
@override
143+
String get verboseLogging => 'Verbose logging';
144+
124145
@override
125146
String get aboutTitle => 'Über';
126147

@@ -132,4 +153,23 @@ class AppLocalizationsDe extends AppLocalizations {
132153

133154
@override
134155
String get repository => 'GitHub Repository';
156+
157+
@override
158+
String get hotkey => 'Hotkey';
159+
160+
@override
161+
String get recordNewHotkey => 'Record a new hotkey';
162+
163+
@override
164+
String get appSpecificHotkeys => 'App specific hotkeys';
165+
166+
@override
167+
String get appSpecificHotkeysTooltip =>
168+
'Hotkeys to directly toggle suspend/resume for specific apps, even when they are not focused.';
169+
170+
@override
171+
String get addAppSpecificHotkey => 'Add app specific hotkey';
172+
173+
@override
174+
String get selectApp => 'Select app';
135175
}

lib/localization/app_localizations_en.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,4 @@ class AppLocalizationsEn extends AppLocalizations {
172172

173173
@override
174174
String get selectApp => 'Select app';
175-
176-
@override
177-
String get show => 'Show';
178-
179-
@override
180-
String get hide => 'Hide';
181-
182-
@override
183-
String get resetWindow => 'Reset Window';
184-
185-
@override
186-
String get exit => 'Exit';
187175
}

lib/localization/app_localizations_it.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class AppLocalizationsIt extends AppLocalizations {
2323
@override
2424
String get favoriteButtonTooltipRemove => 'Remove from favorites';
2525

26+
@override
27+
String get suspendAllInstances => 'Suspend all instances';
28+
29+
@override
30+
String get resumeAllInstances => 'Resume all instances';
31+
32+
@override
33+
String get close => 'Close';
34+
2635
@override
2736
String get detailsDialogTitle => 'Dettagli';
2837

@@ -38,6 +47,15 @@ class AppLocalizationsIt extends AppLocalizations {
3847
@override
3948
String get detailsDialogCurrentStatus => 'Stato attuale';
4049

50+
@override
51+
String get statusNormal => 'Normal';
52+
53+
@override
54+
String get statusSuspended => 'Suspended';
55+
56+
@override
57+
String get statusUnknown => 'Unknown';
58+
4159
@override
4260
String get copyLogs => 'Copia log';
4361

@@ -122,6 +140,9 @@ class AppLocalizationsIt extends AppLocalizations {
122140
@override
123141
String get logs => 'Log';
124142

143+
@override
144+
String get verboseLogging => 'Verbose logging';
145+
125146
@override
126147
String get aboutTitle => 'Informazioni';
127148

@@ -133,4 +154,23 @@ class AppLocalizationsIt extends AppLocalizations {
133154

134155
@override
135156
String get repository => 'Repository GitHub';
157+
158+
@override
159+
String get hotkey => 'Hotkey';
160+
161+
@override
162+
String get recordNewHotkey => 'Record a new hotkey';
163+
164+
@override
165+
String get appSpecificHotkeys => 'App specific hotkeys';
166+
167+
@override
168+
String get appSpecificHotkeysTooltip =>
169+
'Hotkeys to directly toggle suspend/resume for specific apps, even when they are not focused.';
170+
171+
@override
172+
String get addAppSpecificHotkey => 'Add app specific hotkey';
173+
174+
@override
175+
String get selectApp => 'Select app';
136176
}

lib/localization/app_localizations_zh.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,4 @@ class AppLocalizationsZh extends AppLocalizations {
168168

169169
@override
170170
String get selectApp => '选择应用';
171-
172-
@override
173-
String get show => '显示';
174-
175-
@override
176-
String get hide => '隐藏';
177-
178-
@override
179-
String get resetWindow => '重置窗口';
180-
181-
@override
182-
String get exit => '退出';
183171
}

lib/settings/widgets/integration_section.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
44
import 'package:hotkey_manager/hotkey_manager.dart';
55

66
import '../../apps_list/apps_list.dart';
7-
import '../../hotkey/global/hotkey_service.dart';
87
import '../../localization/app_localizations.dart';
98
import '../../theme/styles.dart';
109
import '../settings.dart';
@@ -134,7 +133,7 @@ class _HotkeyConfigWidget extends StatelessWidget {
134133
),
135134
child: BlocBuilder<SettingsCubit, SettingsState>(
136135
builder: (context, state) {
137-
return Text(state.hotKey.toStringHelper());
136+
return Text(state.hotKey.debugName);
138137
},
139138
),
140139
),
@@ -262,7 +261,7 @@ class _AppSpecificHotkeys extends StatelessWidget {
262261
child: Card(
263262
elevation: 2,
264263
child: ListTile(
265-
leading: Text(hotkey.hotkey.toStringHelper()),
264+
leading: Text(hotkey.hotkey.debugName),
266265
title: Text(hotkey.executable),
267266
trailing: ElevatedButton(
268267
onPressed: () => settingsCubit.removeAppSpecificHotkey(

0 commit comments

Comments
 (0)