Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Support the following actions
3. Run Build script

```bash
dart .\setup.dart android
dart ./setup.dart android
```

- windows
Expand All @@ -93,7 +93,7 @@ Support the following actions
3. Run build script

```bash
dart .\setup.dart windows --arch <arm64 | amd64>
dart ./setup.dart windows --arch <arm64 | amd64>
```

- linux
Expand All @@ -103,7 +103,7 @@ Support the following actions
2. Run build script

```bash
dart .\setup.dart linux --arch <arm64 | amd64>
dart ./setup.dart linux --arch <arm64 | amd64>
```

- macOS
Expand All @@ -113,7 +113,7 @@ Support the following actions
2. Run build script

```bash
dart .\setup.dart macos --arch <arm64 | amd64>
dart ./setup.dart macos --arch <arm64 | amd64>
```

## Star
Expand Down
8 changes: 4 additions & 4 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ on Mobile:
3. 运行构建脚本

```bash
dart .\setup.dart android
dart ./setup.dart android
```

- windows
Expand All @@ -93,7 +93,7 @@ on Mobile:
3. 运行构建脚本

```bash
dart .\setup.dart windows --arch <arm64 | amd64>
dart ./setup.dart windows --arch <arm64 | amd64>
```

- linux
Expand All @@ -103,7 +103,7 @@ on Mobile:
2. 运行构建脚本

```bash
dart .\setup.dart linux --arch <arm64 | amd64>
dart ./setup.dart linux --arch <arm64 | amd64>
```

- macOS
Expand All @@ -113,7 +113,7 @@ on Mobile:
2. 运行构建脚本

```bash
dart .\setup.dart macos --arch <arm64 | amd64>
dart ./setup.dart macos --arch <arm64 | amd64>
```

## Star History
Expand Down
Binary file modified assets/images/icon/status_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sounds/notify.wav
Binary file not shown.
12 changes: 12 additions & 0 deletions lib/common/sounds.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:audioplayers/audioplayers.dart';

class Sounds {
static final _player = AudioPlayer();

static Future<void> playNotify() async {
await _player.play(
AssetSource('sounds/notify.wav'),
volume: 1.0,
);
}
}
2 changes: 1 addition & 1 deletion lib/common/tray.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Tray {
}

String getTryIcon({required bool isStart, required bool tunEnable}) {
if (system.isMacOS || !isStart) {
if (!isStart) {
return 'assets/images/icon/status_1.$trayIconSuffix';
}
if (!tunEnable) {
Expand Down
5 changes: 5 additions & 0 deletions lib/manager/hotkey_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hotkey_manager/hotkey_manager.dart';
import 'package:fl_clash/common/sounds.dart';

class HotKeyManager extends ConsumerStatefulWidget {
final Widget child;
Expand Down Expand Up @@ -38,14 +39,18 @@ class _HotKeyManagerState extends ConsumerState<HotKeyManager> {
Future<void> _handleHotKeyAction(HotAction action) async {
switch (action) {
case HotAction.mode:
await Sounds.playNotify();
globalState.appController.updateMode();
case HotAction.start:
await Sounds.playNotify();
globalState.appController.updateStart();
case HotAction.view:
globalState.appController.updateVisible();
case HotAction.proxy:
await Sounds.playNotify();
globalState.appController.updateSystemProxy();
case HotAction.tun:
await Sounds.playNotify();
globalState.appController.updateTun();
}
}
Expand Down
Empty file added lib/manager/sound_manager.dart
Empty file.
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "generated_plugin_registrant.h"

#include <audioplayers_linux/audioplayers_linux_plugin.h>
#include <dynamic_color/dynamic_color_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_js/flutter_js_plugin.h>
Expand All @@ -17,6 +18,9 @@
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
Expand Down
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
audioplayers_linux
dynamic_color
file_selector_linux
flutter_js
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FlutterMacOS
import Foundation

import app_links
import audioplayers_darwin
import connectivity_plus
import device_info_plus
import dynamic_color
Expand All @@ -26,6 +27,7 @@ import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
Expand Down
7 changes: 7 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
PODS:
- app_links (6.4.1):
- FlutterMacOS
- audioplayers_darwin (0.0.1):
- Flutter
- FlutterMacOS
- connectivity_plus (0.0.1):
- FlutterMacOS
- device_info_plus (0.0.1):
Expand Down Expand Up @@ -45,6 +48,7 @@ PODS:

DEPENDENCIES:
- app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`)
- audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/darwin`)
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`)
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
- dynamic_color (from `Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos`)
Expand All @@ -71,6 +75,8 @@ SPEC REPOS:
EXTERNAL SOURCES:
app_links:
:path: Flutter/ephemeral/.symlinks/plugins/app_links/macos
audioplayers_darwin:
:path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/darwin
connectivity_plus:
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos
device_info_plus:
Expand Down Expand Up @@ -110,6 +116,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f
audioplayers_darwin: 4f9ca89d92d3d21cec7ec580e78ca888e5fb68bd
connectivity_plus: 4adf20a405e25b42b9c9f87feff8f4b6fde18a4e
device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
dynamic_color: cb7c2a300ee67ed3bd96c3e852df3af0300bf610
Expand Down
Loading