mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-07 07:49:43 +00:00
Compare commits
1 Commits
e91255a964
...
b66fe08047
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b66fe08047 |
2
.github/workflows/pr-lint.yml
vendored
2
.github/workflows/pr-lint.yml
vendored
@ -4,7 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: 3.29.1
|
FLUTTER_VERSION: 3.29.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
|
|||||||
2
.github/workflows/spotube-release-binary.yml
vendored
2
.github/workflows/spotube-release-binary.yml
vendored
@ -20,7 +20,7 @@ on:
|
|||||||
description: Dry run without uploading to release
|
description: Dry run without uploading to release
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: 3.29.1
|
FLUTTER_VERSION: 3.29.0
|
||||||
FLUTTER_CHANNEL: master
|
FLUTTER_CHANNEL: master
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@ -75,17 +75,17 @@ class AppRouter extends RootStackRouter {
|
|||||||
path: "local",
|
path: "local",
|
||||||
page: UserLocalLibraryRoute.page,
|
page: UserLocalLibraryRoute.page,
|
||||||
),
|
),
|
||||||
|
AutoRoute(
|
||||||
|
path: "local/folder",
|
||||||
|
page: LocalLibraryRoute.page,
|
||||||
|
// parentNavigatorKey: shellRouteNavigatorKey,
|
||||||
|
),
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
path: "downloads",
|
path: "downloads",
|
||||||
page: UserDownloadsRoute.page,
|
page: UserDownloadsRoute.page,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
AutoRoute(
|
|
||||||
path: "local/folder",
|
|
||||||
page: LocalLibraryRoute.page,
|
|
||||||
// parentNavigatorKey: shellRouteNavigatorKey,
|
|
||||||
),
|
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
path: "library/generate",
|
path: "library/generate",
|
||||||
page: PlaylistGeneratorRoute.page,
|
page: PlaylistGeneratorRoute.page,
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class AdaptiveMenuButton<T> extends MenuButton {
|
|||||||
/// or equal to 640px
|
/// or equal to 640px
|
||||||
/// In smaller screen, a [IconButton] with a [showModalBottomSheet] is shown
|
/// In smaller screen, a [IconButton] with a [showModalBottomSheet] is shown
|
||||||
class AdaptivePopSheetList<T> extends StatelessWidget {
|
class AdaptivePopSheetList<T> extends StatelessWidget {
|
||||||
final List<AdaptiveMenuButton<T>> Function(BuildContext context) items;
|
final List<AdaptiveMenuButton<T>> children;
|
||||||
final Widget? icon;
|
final Widget? icon;
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final bool useRootNavigator;
|
final bool useRootNavigator;
|
||||||
@ -43,7 +43,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
|
|
||||||
const AdaptivePopSheetList({
|
const AdaptivePopSheetList({
|
||||||
super.key,
|
super.key,
|
||||||
required this.items,
|
required this.children,
|
||||||
this.icon,
|
this.icon,
|
||||||
this.child,
|
this.child,
|
||||||
this.useRootNavigator = true,
|
this.useRootNavigator = true,
|
||||||
@ -59,28 +59,27 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
|
|
||||||
Future<void> showDropdownMenu(BuildContext context, Offset position) async {
|
Future<void> showDropdownMenu(BuildContext context, Offset position) async {
|
||||||
final mediaQuery = MediaQuery.of(context);
|
final mediaQuery = MediaQuery.of(context);
|
||||||
List<MenuButton> childrenModified(BuildContext context) =>
|
final childrenModified = children.map((s) {
|
||||||
items(context).map((s) {
|
if (s.onPressed == null) {
|
||||||
if (s.onPressed == null) {
|
return MenuButton(
|
||||||
return MenuButton(
|
key: s.key,
|
||||||
key: s.key,
|
autoClose: s.autoClose,
|
||||||
autoClose: s.autoClose,
|
enabled: s.enabled,
|
||||||
enabled: s.enabled,
|
leading: s.leading,
|
||||||
leading: s.leading,
|
focusNode: s.focusNode,
|
||||||
focusNode: s.focusNode,
|
onPressed: (context) {
|
||||||
onPressed: (context) {
|
if (s.value != null) {
|
||||||
if (s.value != null) {
|
onSelected?.call(s.value as T);
|
||||||
onSelected?.call(s.value as T);
|
}
|
||||||
}
|
},
|
||||||
},
|
popoverController: s.popoverController,
|
||||||
popoverController: s.popoverController,
|
subMenu: s.subMenu,
|
||||||
subMenu: s.subMenu,
|
trailing: s.trailing,
|
||||||
trailing: s.trailing,
|
child: s.child,
|
||||||
child: s.child,
|
);
|
||||||
);
|
}
|
||||||
}
|
return s;
|
||||||
return s;
|
}).toList();
|
||||||
}).toList();
|
|
||||||
|
|
||||||
if (mediaQuery.mdAndUp) {
|
if (mediaQuery.mdAndUp) {
|
||||||
await showDropdown<T?>(
|
await showDropdown<T?>(
|
||||||
@ -93,7 +92,7 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
position: position,
|
position: position,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return DropdownMenu(
|
return DropdownMenu(
|
||||||
children: childrenModified(context),
|
children: childrenModified,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).future;
|
).future;
|
||||||
@ -110,12 +109,11 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
backgroundColor: context.theme.colorScheme.card,
|
backgroundColor: context.theme.colorScheme.card,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final children = childrenModified(context);
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: children.length,
|
itemCount: childrenModified.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final data = children[index];
|
final data = childrenModified[index];
|
||||||
|
|
||||||
return Button(
|
return Button(
|
||||||
enabled: data.enabled,
|
enabled: data.enabled,
|
||||||
|
|||||||
126
lib/components/animated_gradient.dart
Normal file
126
lib/components/animated_gradient.dart
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
|
||||||
|
class AnimateGradient extends HookWidget {
|
||||||
|
const AnimateGradient({
|
||||||
|
super.key,
|
||||||
|
required this.primaryColors,
|
||||||
|
required this.secondaryColors,
|
||||||
|
this.child,
|
||||||
|
this.primaryBegin,
|
||||||
|
this.primaryEnd,
|
||||||
|
this.secondaryBegin,
|
||||||
|
this.secondaryEnd,
|
||||||
|
AnimationController? controller,
|
||||||
|
this.duration = const Duration(seconds: 4),
|
||||||
|
this.animateAlignments = true,
|
||||||
|
this.reverse = true,
|
||||||
|
}) : assert(primaryColors.length >= 2),
|
||||||
|
assert(primaryColors.length == secondaryColors.length),
|
||||||
|
_controller = controller;
|
||||||
|
|
||||||
|
/// [controller]: pass this to have a fine control over the [Animation]
|
||||||
|
final AnimationController? _controller;
|
||||||
|
|
||||||
|
/// [duration]: Time to switch between [Gradient].
|
||||||
|
/// By default its value is [Duration(seconds:4)]
|
||||||
|
final Duration duration;
|
||||||
|
|
||||||
|
/// [primaryColors]: These will be the starting colors of the [Animation].
|
||||||
|
final List<Color> primaryColors;
|
||||||
|
|
||||||
|
/// [secondaryColors]: These Colors are those in which the [primaryColors] will transition into.
|
||||||
|
final List<Color> secondaryColors;
|
||||||
|
|
||||||
|
/// [primaryBegin]: This is begin [Alignment] for [primaryColors].
|
||||||
|
/// By default its value is [Alignment.topLeft]
|
||||||
|
final Alignment? primaryBegin;
|
||||||
|
|
||||||
|
/// [primaryBegin]: This is end [Alignment] for [primaryColors].
|
||||||
|
/// By default its value is [Alignment.topRight]
|
||||||
|
final Alignment? primaryEnd;
|
||||||
|
|
||||||
|
/// [secondaryBegin]: This is begin [Alignment] for [secondaryColors].
|
||||||
|
/// By default its value is [Alignment.bottomLeft]
|
||||||
|
final Alignment? secondaryBegin;
|
||||||
|
|
||||||
|
/// [secondaryEnd]: This is end [Alignment] for [secondaryColors].
|
||||||
|
/// By default its value is [Alignment.bottomRight]
|
||||||
|
final Alignment? secondaryEnd;
|
||||||
|
|
||||||
|
/// [animateAlignments]: set to false if you don't want to animate the alignments.
|
||||||
|
/// This can provide you way cooler animations
|
||||||
|
final bool animateAlignments;
|
||||||
|
|
||||||
|
/// [reverse]: set it to false if you don't want to reverse the animation.
|
||||||
|
/// using that it will go into one direction only
|
||||||
|
final bool reverse;
|
||||||
|
|
||||||
|
final Widget? child;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// ignore: no_leading_underscores_for_local_identifiers
|
||||||
|
final __controller = useAnimationController(
|
||||||
|
duration: duration,
|
||||||
|
)..repeat(reverse: reverse);
|
||||||
|
|
||||||
|
final controller = _controller ?? __controller;
|
||||||
|
|
||||||
|
final animation = useMemoized(
|
||||||
|
() => CurvedAnimation(
|
||||||
|
parent: controller,
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
),
|
||||||
|
[controller]);
|
||||||
|
|
||||||
|
final colorTween = useMemoized(
|
||||||
|
() => primaryColors.map((color) {
|
||||||
|
return ColorTween(
|
||||||
|
begin: color,
|
||||||
|
end: color,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
[primaryColors]);
|
||||||
|
final colors = useMemoized(
|
||||||
|
() => colorTween.map((color) {
|
||||||
|
return color.evaluate(animation)!;
|
||||||
|
}).toList(),
|
||||||
|
[colorTween, animation]);
|
||||||
|
|
||||||
|
final begin = useMemoized(
|
||||||
|
() => AlignmentTween(
|
||||||
|
begin: primaryBegin ?? Alignment.topLeft,
|
||||||
|
end: primaryEnd ?? Alignment.topRight,
|
||||||
|
),
|
||||||
|
[primaryBegin, primaryEnd]);
|
||||||
|
|
||||||
|
final end = useMemoized(
|
||||||
|
() => AlignmentTween(
|
||||||
|
begin: secondaryBegin ?? Alignment.bottomLeft,
|
||||||
|
end: secondaryEnd ?? Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
[secondaryBegin, secondaryEnd]);
|
||||||
|
|
||||||
|
return AnimatedBuilder(
|
||||||
|
animation: animation,
|
||||||
|
child: useMemoized(() => child, [child]),
|
||||||
|
builder: (BuildContext context, Widget? child) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: animateAlignments
|
||||||
|
? begin.evaluate(animation)
|
||||||
|
: (primaryBegin as Alignment),
|
||||||
|
end: animateAlignments
|
||||||
|
? end.evaluate(animation)
|
||||||
|
: primaryEnd as Alignment,
|
||||||
|
colors: colors,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
lib/components/spotube_page_route.dart
Normal file
24
lib/components/spotube_page_route.dart
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
||||||
|
|
||||||
|
class SpotubePage<T> extends MaterialPage<T> {
|
||||||
|
const SpotubePage({required super.child});
|
||||||
|
}
|
||||||
|
|
||||||
|
// class SpotubeSlidePage extends CustomTransitionPage {
|
||||||
|
// SpotubeSlidePage({
|
||||||
|
// required super.child,
|
||||||
|
// super.key,
|
||||||
|
// }) : super(
|
||||||
|
// reverseTransitionDuration: const Duration(milliseconds: 150),
|
||||||
|
// transitionDuration: const Duration(milliseconds: 150),
|
||||||
|
// transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
// return SlideTransition(
|
||||||
|
// position: Tween<Offset>(
|
||||||
|
// begin: const Offset(1, 0),
|
||||||
|
// end: Offset.zero,
|
||||||
|
// ).animate(animation),
|
||||||
|
// child: child,
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
@ -166,7 +166,7 @@ class TrackPresentationActionsSection extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
icon: const Icon(SpotubeIcons.moreVertical),
|
icon: const Icon(SpotubeIcons.moreVertical),
|
||||||
variance: ButtonVariance.outline,
|
variance: ButtonVariance.outline,
|
||||||
items: (context) => [
|
children: [
|
||||||
AdaptiveMenuButton(
|
AdaptiveMenuButton(
|
||||||
value: "download",
|
value: "download",
|
||||||
leading: const Icon(SpotubeIcons.download),
|
leading: const Icon(SpotubeIcons.download),
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class SortTracksDropdown extends StatelessWidget {
|
|||||||
onSelected: onChanged,
|
onSelected: onChanged,
|
||||||
tooltip: context.l10n.sort_tracks,
|
tooltip: context.l10n.sort_tracks,
|
||||||
icon: const Icon(SpotubeIcons.sort),
|
icon: const Icon(SpotubeIcons.sort),
|
||||||
items: (context) => [
|
children: [
|
||||||
AdaptiveMenuButton(
|
AdaptiveMenuButton(
|
||||||
value: SortBy.none,
|
value: SortBy.none,
|
||||||
enabled: value != SortBy.none,
|
enabled: value != SortBy.none,
|
||||||
|
|||||||
@ -90,25 +90,11 @@ class TrackOptions extends HookConsumerWidget {
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
Track track,
|
Track track,
|
||||||
) {
|
) {
|
||||||
/// showDialog doesn't work for some reason. So we have to
|
showDialog(
|
||||||
/// manually push a Dialog Route in the Navigator to get it working
|
context: context,
|
||||||
Navigator.push(
|
builder: (context) => PlaylistAddTrackDialog(
|
||||||
context,
|
tracks: [track],
|
||||||
DialogRoute(
|
openFromPlaylist: playlistId,
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
transitionBuilder: (context, animation, secondaryAnimation, child) {
|
|
||||||
return FadeTransition(opacity: animation, child: child);
|
|
||||||
},
|
|
||||||
context: context,
|
|
||||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
|
||||||
builder: (context) {
|
|
||||||
return Center(
|
|
||||||
child: PlaylistAddTrackDialog(
|
|
||||||
tracks: [track],
|
|
||||||
openFromPlaylist: playlistId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -366,7 +352,7 @@ class TrackOptions extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
items: (context) => [
|
children: [
|
||||||
if (isLocalTrack)
|
if (isLocalTrack)
|
||||||
AdaptiveMenuButton(
|
AdaptiveMenuButton(
|
||||||
value: TrackOptionValue.delete,
|
value: TrackOptionValue.delete,
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import 'package:spotube/provider/audio_player/audio_player.dart';
|
|||||||
import 'package:spotube/provider/server/active_sourced_track.dart';
|
import 'package:spotube/provider/server/active_sourced_track.dart';
|
||||||
import 'package:spotube/provider/volume_provider.dart';
|
import 'package:spotube/provider/volume_provider.dart';
|
||||||
import 'package:spotube/services/sourced_track/sources/youtube.dart';
|
import 'package:spotube/services/sourced_track/sources/youtube.dart';
|
||||||
import 'package:spotube/utils/platform.dart';
|
|
||||||
|
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
@ -102,8 +101,7 @@ class PlayerView extends HookConsumerWidget {
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
headers: [
|
headers: [
|
||||||
SafeArea(
|
SafeArea(
|
||||||
minimum:
|
minimum: const EdgeInsets.only(top: 80),
|
||||||
kIsMobile ? const EdgeInsets.only(top: 80) : EdgeInsets.zero,
|
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: TitleBar(
|
child: TitleBar(
|
||||||
surfaceOpacity: 0,
|
surfaceOpacity: 0,
|
||||||
|
|||||||
@ -191,7 +191,7 @@ class PlayerActions extends HookConsumerWidget {
|
|||||||
sleepTimerNotifier.setSleepTimer(value);
|
sleepTimerNotifier.setSleepTimer(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
items: (context) => [
|
children: [
|
||||||
for (final entry in sleepTimerEntries.entries)
|
for (final entry in sleepTimerEntries.entries)
|
||||||
AdaptiveMenuButton(
|
AdaptiveMenuButton(
|
||||||
value: entry.value,
|
value: entry.value,
|
||||||
|
|||||||
@ -101,17 +101,11 @@ class PlaylistCreateDialog extends HookConsumerWidget {
|
|||||||
} else {
|
} else {
|
||||||
await playlistNotifier.create(payload, onError);
|
await playlistNotifier.create(payload, onError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trackIds.isNotEmpty) {
|
|
||||||
await playlistNotifier.addTracks(trackIds, onError);
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
isSubmitting.value = false;
|
isSubmitting.value = false;
|
||||||
if (context.mounted &&
|
if (context.mounted &&
|
||||||
!ref.read(playlistProvider(playlistId ?? "")).hasError) {
|
!ref.read(playlistProvider(playlistId ?? "")).hasError) {
|
||||||
context.router.maybePop<Playlist>(
|
context.router.maybePop();
|
||||||
await ref.read(playlistProvider(playlistId ?? "").future),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,38 +133,37 @@ class GettingStartedPageLanguageRegionSection extends HookConsumerWidget {
|
|||||||
popup: SelectPopup.builder(
|
popup: SelectPopup.builder(
|
||||||
searchPlaceholder: Text(context.l10n.search),
|
searchPlaceholder: Text(context.l10n.search),
|
||||||
builder: (context, searchQuery) {
|
builder: (context, searchQuery) {
|
||||||
final hasNotQueried =
|
final filteredLocale = searchQuery?.isNotEmpty != true
|
||||||
searchQuery == null || searchQuery.trim().isEmpty;
|
? L10n.all
|
||||||
final filteredLocale = hasNotQueried
|
|
||||||
? [
|
|
||||||
const Locale("system", "system"),
|
|
||||||
...L10n.all,
|
|
||||||
]
|
|
||||||
: L10n.all
|
: L10n.all
|
||||||
.where(
|
.where(
|
||||||
(element) => filterLocale(
|
(element) =>
|
||||||
element,
|
filterLocale(element, searchQuery!),
|
||||||
searchQuery.trim(),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return SelectItemBuilder(
|
return SelectItemBuilder(
|
||||||
childCount: filteredLocale.length,
|
childCount: filteredLocale.length + 1,
|
||||||
builder: (context, index) {
|
builder: (context, index) {
|
||||||
final locale = filteredLocale[index];
|
if (index == 0 &&
|
||||||
if (locale == const Locale("system", "system")) {
|
searchQuery?.isNotEmpty != true) {
|
||||||
return SelectItemButton(
|
return SelectItemButton(
|
||||||
value: locale,
|
value: const Locale("system", "system"),
|
||||||
child: Text(context.l10n.system_default),
|
child: Text(context.l10n.system_default),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final indexThen = searchQuery?.isNotEmpty != true
|
||||||
|
? index
|
||||||
|
: index - 1;
|
||||||
|
|
||||||
|
final locale = filteredLocale[indexThen];
|
||||||
return SelectItemButton(
|
return SelectItemButton(
|
||||||
value: locale,
|
value: locale,
|
||||||
child: Text(
|
child: Text(
|
||||||
LanguageLocals.getDisplayLanguage(
|
LanguageLocals.getDisplayLanguage(
|
||||||
locale.languageCode,
|
locale.languageCode)
|
||||||
).toString(),
|
.toString(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -96,9 +96,7 @@ class LastFMLoginPage extends HookConsumerWidget {
|
|||||||
FormField(
|
FormField(
|
||||||
label: Text(context.l10n.username),
|
label: Text(context.l10n.username),
|
||||||
key: usernameKey,
|
key: usernameKey,
|
||||||
validator: const NotEmptyValidator(
|
validator: const NotEmptyValidator(),
|
||||||
message: "Username is required",
|
|
||||||
),
|
|
||||||
child: TextField(
|
child: TextField(
|
||||||
autofillHints: const [
|
autofillHints: const [
|
||||||
AutofillHints.username,
|
AutofillHints.username,
|
||||||
@ -109,9 +107,7 @@ class LastFMLoginPage extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
FormField(
|
FormField(
|
||||||
key: passwordKey,
|
key: passwordKey,
|
||||||
validator: const NotEmptyValidator(
|
validator: const NotEmptyValidator(),
|
||||||
message: "Password is required",
|
|
||||||
),
|
|
||||||
label: Text(context.l10n.password),
|
label: Text(context.l10n.password),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
autofillHints: const [
|
autofillHints: const [
|
||||||
|
|||||||
@ -81,7 +81,6 @@ class LyricsPage extends HookConsumerWidget {
|
|||||||
title: tabbar,
|
title: tabbar,
|
||||||
height: 58 * context.theme.scaling,
|
height: 58 * context.theme.scaling,
|
||||||
surfaceBlur: 0,
|
surfaceBlur: 0,
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
)
|
)
|
||||||
: tabbar
|
: tabbar
|
||||||
],
|
],
|
||||||
|
|||||||
@ -24,9 +24,6 @@ const supportedAudioTypes = [
|
|||||||
"audio/opus",
|
"audio/opus",
|
||||||
"audio/wav",
|
"audio/wav",
|
||||||
"audio/aac",
|
"audio/aac",
|
||||||
"audio/flac",
|
|
||||||
"audio/x-flac",
|
|
||||||
"audio/x-wav",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const imgMimeToExt = {
|
const imgMimeToExt = {
|
||||||
@ -71,16 +68,13 @@ final localTracksProvider =
|
|||||||
await Directory(location).list(recursive: true).toList();
|
await Directory(location).list(recursive: true).toList();
|
||||||
|
|
||||||
entities.addAll(
|
entities.addAll(
|
||||||
dirEntities.where(
|
dirEntities
|
||||||
(e) {
|
.where(
|
||||||
final mime = lookupMimeType(e.path) ??
|
(e) =>
|
||||||
(extension(e.path) == ".opus" ? "audio/opus" : null);
|
e is File &&
|
||||||
|
supportedAudioTypes.contains(lookupMimeType(e.path)),
|
||||||
print("${basename(e.path)}: $mime");
|
)
|
||||||
|
.cast<File>(),
|
||||||
return e is File && supportedAudioTypes.contains(mime);
|
|
||||||
},
|
|
||||||
).cast<File>(),
|
|
||||||
);
|
);
|
||||||
} catch (e, stack) {
|
} catch (e, stack) {
|
||||||
AppLogger.reportError(e, stack);
|
AppLogger.reportError(e, stack);
|
||||||
|
|||||||
@ -98,23 +98,6 @@ class PlaylistNotifier extends FamilyAsyncNotifier<Playlist, String> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addTracks(List<String> trackIds, [ValueChanged? onError]) async {
|
|
||||||
try {
|
|
||||||
if (state.value == null) return;
|
|
||||||
|
|
||||||
final spotify = ref.read(spotifyProvider);
|
|
||||||
|
|
||||||
await spotify.playlists.addTracks(
|
|
||||||
trackIds.map((id) => "spotify:track:$id").toList(),
|
|
||||||
state.value!.id!,
|
|
||||||
);
|
|
||||||
} catch (e, stack) {
|
|
||||||
onError?.call(e);
|
|
||||||
AppLogger.reportError(e, stack);
|
|
||||||
rethrow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final playlistProvider =
|
final playlistProvider =
|
||||||
|
|||||||
@ -1539,10 +1539,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: mime
|
name: mime
|
||||||
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
|
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "1.0.6"
|
||||||
nm:
|
nm:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
42
pubspec.yaml
42
pubspec.yaml
@ -88,7 +88,7 @@ dependencies:
|
|||||||
media_kit: ^1.1.10+1
|
media_kit: ^1.1.10+1
|
||||||
media_kit_libs_audio: ^1.0.4
|
media_kit_libs_audio: ^1.0.4
|
||||||
metadata_god: ^1.0.0
|
metadata_god: ^1.0.0
|
||||||
mime: ^2.0.0
|
mime: ^1.0.2
|
||||||
open_file: ^3.5.10
|
open_file: ^3.5.10
|
||||||
package_info_plus: ^6.0.0
|
package_info_plus: ^6.0.0
|
||||||
palette_generator: ^0.3.3
|
palette_generator: ^0.3.3
|
||||||
@ -193,6 +193,46 @@ flutter:
|
|||||||
- packages/flutter_undraw/assets/undraw/empty.svg
|
- packages/flutter_undraw/assets/undraw/empty.svg
|
||||||
- packages/flutter_undraw/assets/undraw/no_data.svg
|
- packages/flutter_undraw/assets/undraw/no_data.svg
|
||||||
fonts:
|
fonts:
|
||||||
|
- family: GeistSans
|
||||||
|
fonts:
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Black.otf
|
||||||
|
weight: 800
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Bold.otf
|
||||||
|
weight: 700
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Light.otf
|
||||||
|
weight: 300
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Medium.otf
|
||||||
|
weight: 500
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-SemiBold.otf
|
||||||
|
weight: 600
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Thin.otf
|
||||||
|
weight: 100
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-UltraBlack.otf
|
||||||
|
weight: 900
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-UltraLight.otf
|
||||||
|
weight: 200
|
||||||
|
- asset: packages/shadcn_flutter/fonts/Geist-Regular.otf
|
||||||
|
weight: 400
|
||||||
|
- family: GeistMono
|
||||||
|
fonts:
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Black.otf
|
||||||
|
weight: 800
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Bold.otf
|
||||||
|
weight: 700
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Light.otf
|
||||||
|
weight: 300
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Medium.otf
|
||||||
|
weight: 500
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Regular.otf
|
||||||
|
weight: 400
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-SemiBold.otf
|
||||||
|
weight: 600
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-Thin.otf
|
||||||
|
weight: 100
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-UltraBlack.otf
|
||||||
|
weight: 900
|
||||||
|
- asset: packages/shadcn_flutter/fonts/GeistMono-UltraLight.otf
|
||||||
|
weight: 200
|
||||||
- family: RadixIcons
|
- family: RadixIcons
|
||||||
fonts:
|
fonts:
|
||||||
- asset: packages/shadcn_flutter/icons/RadixIcons.otf
|
- asset: packages/shadcn_flutter/icons/RadixIcons.otf
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user