mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-02-04 07:52:55 +00:00
Compare commits
5 Commits
272eace897
...
77ee387b00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77ee387b00 | ||
|
|
c709de6bf1 | ||
|
|
ff252d6b14 | ||
|
|
195cad8f39 | ||
|
|
19f525fa3c |
@ -1,126 +0,0 @@
|
|||||||
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,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
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,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
@ -137,16 +137,16 @@
|
|||||||
"pre_download_play_description": "Anzi che effettuare lo stream dell'audio, scarica invece i byte e li riproduce (raccomandato per gli utenti con banda più alta)",
|
"pre_download_play_description": "Anzi che effettuare lo stream dell'audio, scarica invece i byte e li riproduce (raccomandato per gli utenti con banda più alta)",
|
||||||
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
|
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
|
||||||
"blacklist_description": "Tracce e artisti in blacklist",
|
"blacklist_description": "Tracce e artisti in blacklist",
|
||||||
"wait_for_download_to_finish": "Prego attendere che lo scaricamento corrente finisca",
|
"wait_for_download_to_finish": "Prego attendere che il download corrente finisca",
|
||||||
"desktop": "Desktop",
|
"desktop": "Desktop",
|
||||||
"close_behavior": "Comportamento Chiusura",
|
"close_behavior": "Comportamento Chiusura",
|
||||||
"close": "Chiudi",
|
"close": "Chiudi",
|
||||||
"minimize_to_tray": "Minimizza in tray",
|
"minimize_to_tray": "Minimizza in tray",
|
||||||
"show_tray_icon": "Mostra icona in tray di sistema",
|
"show_tray_icon": "Mostra icona in tray di sistema",
|
||||||
"about": "A proposito di",
|
"about": "Informazioni su",
|
||||||
"u_love_spotube": "Sappiamo che ami Spotube",
|
"u_love_spotube": "Sappiamo che ami Spotube",
|
||||||
"check_for_updates": "Controlla aggiornamenti",
|
"check_for_updates": "Controlla aggiornamenti",
|
||||||
"about_spotube": "A proposito di Spotube",
|
"about_spotube": "Informazioni su Spotube",
|
||||||
"blacklist": "Blacklist",
|
"blacklist": "Blacklist",
|
||||||
"please_sponsor": "Per favore sponsorizza/dona",
|
"please_sponsor": "Per favore sponsorizza/dona",
|
||||||
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
||||||
@ -187,7 +187,7 @@
|
|||||||
"generate_playlist": "Genera Playlist",
|
"generate_playlist": "Genera Playlist",
|
||||||
"track_exists": "La traccia {track} esiste già",
|
"track_exists": "La traccia {track} esiste già",
|
||||||
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
|
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
|
||||||
"skip_download_tracks": "Salta lo scaricamento di tutte le tracce scaricate",
|
"skip_download_tracks": "Salta il download di tutte le tracce scaricate",
|
||||||
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
|
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
|
||||||
"replace": "Sovrascrivi",
|
"replace": "Sovrascrivi",
|
||||||
"skip": "Salta",
|
"skip": "Salta",
|
||||||
@ -256,7 +256,7 @@
|
|||||||
"querying_info": "Richiesta informazioni...",
|
"querying_info": "Richiesta informazioni...",
|
||||||
"piped_api_down": "Le Piped API non funzionano",
|
"piped_api_down": "Le Piped API non funzionano",
|
||||||
"piped_down_error_instructions": "L'istanza di Piped {pipedInstance} è correntemente offline\n\nCambia istanza o cambia 'Tipo API' alle API ufficiali YouTube\n\nAssicurati di riavviare l'app dopo il cambio",
|
"piped_down_error_instructions": "L'istanza di Piped {pipedInstance} è correntemente offline\n\nCambia istanza o cambia 'Tipo API' alle API ufficiali YouTube\n\nAssicurati di riavviare l'app dopo il cambio",
|
||||||
"you_are_offline": "Sei correntemente offline",
|
"you_are_offline": "Al momento sei offline",
|
||||||
"connection_restored": "Connessione ad internet ripristinata",
|
"connection_restored": "Connessione ad internet ripristinata",
|
||||||
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
||||||
"crunching_results": "Elaborazione risultati...",
|
"crunching_results": "Elaborazione risultati...",
|
||||||
@ -267,15 +267,15 @@
|
|||||||
"change_cover": "Cambia copertina",
|
"change_cover": "Cambia copertina",
|
||||||
"add_cover": "Aggiungi copertina",
|
"add_cover": "Aggiungi copertina",
|
||||||
"restore_defaults": "Ripristina default",
|
"restore_defaults": "Ripristina default",
|
||||||
"download_music_codec": "Codec musicale scaricamento",
|
"download_music_codec": "Codec download musica",
|
||||||
"streaming_music_codec": "Codec musicale streaming",
|
"streaming_music_codec": "Codec streaming musica",
|
||||||
"login_with_lastfm": "Accesso a Last.fm",
|
"login_with_lastfm": "Accedi con Last.fm",
|
||||||
"connect": "Connetti",
|
"connect": "Connettiti",
|
||||||
"disconnect_lastfm": "Disconnetti Last.fm",
|
"disconnect_lastfm": "Disconnettiti da Last.fm",
|
||||||
"disconnect": "Disconnetti",
|
"disconnect": "Disconnetti",
|
||||||
"username": "Nome utente",
|
"username": "Nome utente",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"login": "Accesso",
|
"login": "Accedi",
|
||||||
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
||||||
"scrobble_to_lastfm": "Invia a Last.fm",
|
"scrobble_to_lastfm": "Invia a Last.fm",
|
||||||
"audio_source": "Fonte audio",
|
"audio_source": "Fonte audio",
|
||||||
@ -299,7 +299,7 @@
|
|||||||
"song_link": "Link della Canzone",
|
"song_link": "Link della Canzone",
|
||||||
"skip_this_nonsense": "Salta questa sciocchezza",
|
"skip_this_nonsense": "Salta questa sciocchezza",
|
||||||
"freedom_of_music": "“Libertà della Musica”",
|
"freedom_of_music": "“Libertà della Musica”",
|
||||||
"freedom_of_music_palm": "“Libertà della Musica nel palmo della tua mano”",
|
"freedom_of_music_palm": "“Libertà della Musica nelle tue mani”",
|
||||||
"get_started": "Cominciamo",
|
"get_started": "Cominciamo",
|
||||||
"youtube_source_description": "Consigliato e funziona meglio.",
|
"youtube_source_description": "Consigliato e funziona meglio.",
|
||||||
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
||||||
|
|||||||
@ -133,37 +133,38 @@ 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 filteredLocale = searchQuery?.isNotEmpty != true
|
final hasNotQueried =
|
||||||
? L10n.all
|
searchQuery == null || searchQuery.trim().isEmpty;
|
||||||
|
final filteredLocale = hasNotQueried
|
||||||
|
? [
|
||||||
|
const Locale("system", "system"),
|
||||||
|
...L10n.all,
|
||||||
|
]
|
||||||
: L10n.all
|
: L10n.all
|
||||||
.where(
|
.where(
|
||||||
(element) =>
|
(element) => filterLocale(
|
||||||
filterLocale(element, searchQuery!),
|
element,
|
||||||
|
searchQuery.trim(),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return SelectItemBuilder(
|
return SelectItemBuilder(
|
||||||
childCount: filteredLocale.length + 1,
|
childCount: filteredLocale.length,
|
||||||
builder: (context, index) {
|
builder: (context, index) {
|
||||||
if (index == 0 &&
|
final locale = filteredLocale[index];
|
||||||
searchQuery?.isNotEmpty != true) {
|
if (locale == const Locale("system", "system")) {
|
||||||
return SelectItemButton(
|
return SelectItemButton(
|
||||||
value: const Locale("system", "system"),
|
value: locale,
|
||||||
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(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user