🐛 Fix windows duplicate icon buttons
This commit is contained in:
@@ -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<String>()
|
||||
.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),
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user