From 4a115122f9d99884532c7e75a358982591d56e58 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 20 Dec 2025 15:44:56 +0800 Subject: [PATCH] :bug: Fix windows duplicate icon buttons --- lib/ui/shell.dart | 101 ---------------------------------------------- pubspec.yaml | 5 +-- 2 files changed, 2 insertions(+), 104 deletions(-) diff --git a/lib/ui/shell.dart b/lib/ui/shell.dart index 07ce4ba..12f041f 100644 --- a/lib/ui/shell.dart +++ b/lib/ui/shell.dart @@ -241,107 +241,6 @@ class Shell extends HookConsumerWidget { ], ).padding(horizontal: 12, vertical: 5), ), - // Settings button - IconButton( - icon: Icon(Symbols.settings), - onPressed: () => - context.go(AppRoutes.settings), - iconSize: 16, - padding: EdgeInsets.all(8), - constraints: BoxConstraints(), - color: Theme.of(context).iconTheme.color, - ), - // Import button - IconButton( - icon: Icon(Symbols.add_circle_outline), - tooltip: 'Import Files', - onPressed: () async { - final result = await FilePicker.platform - .pickFiles( - type: FileType.custom, - allowedExtensions: const [ - 'mp3', - 'm4a', - 'wav', - 'flac', - 'aac', - 'ogg', - 'wma', - 'm4p', - 'aiff', - 'au', - 'dss', - 'lrc', - 'srt', - 'txt', - ], - allowMultiple: true, - ); - if (result != null && - result.files.isNotEmpty) { - final paths = result.files - .map((f) => f.path) - .whereType() - .toList(); - if (paths.isNotEmpty) { - final repo = ref.read( - trackRepositoryProvider.notifier, - ); - - // Separate audio and lyrics files - final audioPaths = paths.where((path) { - final ext = p - .extension(path) - .toLowerCase() - .replaceFirst('.', ''); - return const [ - 'mp3', - 'm4a', - 'wav', - 'flac', - 'aac', - 'ogg', - 'wma', - 'm4p', - 'aiff', - 'au', - 'dss', - ].contains(ext); - }).toList(); - final lyricsPaths = paths.where((path) { - final ext = p - .extension(path) - .toLowerCase() - .replaceFirst('.', ''); - return const [ - 'lrc', - 'srt', - 'txt', - ].contains(ext); - }).toList(); - - // Import tracks if any - if (audioPaths.isNotEmpty) { - await repo.importFiles(audioPaths); - } - - // Import lyrics if any - if (!context.mounted) return; - if (lyricsPaths.isNotEmpty) { - await _batchImportLyricsFromPaths( - context, - ref, - lyricsPaths, - ); - } - } - } - }, - iconSize: 16, - padding: EdgeInsets.all(8), - constraints: BoxConstraints(), - color: Theme.of(context).iconTheme.color, - ), ...pageActionsButton, IconButton( icon: Icon(Symbols.minimize), diff --git a/pubspec.yaml b/pubspec.yaml index 9530a69..8ac9f12 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: groovybox description: "A new local music player." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+46 +version: 1.0.0+47 environment: sdk: ^3.10.1 @@ -84,7 +84,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.