diff --git a/lib/collections/intents.dart b/lib/collections/intents.dart index e4e3fa07..42c580ca 100644 --- a/lib/collections/intents.dart +++ b/lib/collections/intents.dart @@ -75,7 +75,7 @@ class HomeTabAction extends Action { router.navigate(const SearchRoute()); break; case HomeTabs.lyrics: - router.navigate(LyricsRoute()); + router.navigate(const LyricsRoute()); break; case HomeTabs.userPlaylists: router.navigate(const UserPlaylistsRoute()); diff --git a/lib/collections/side_bar_tiles.dart b/lib/collections/side_bar_tiles.dart index 80ca7306..c647c9fb 100644 --- a/lib/collections/side_bar_tiles.dart +++ b/lib/collections/side_bar_tiles.dart @@ -38,7 +38,7 @@ List getSidebarTileList(AppLocalizations l10n) => [ SideBarTiles( id: "lyrics", pathPrefix: "/lyrics", - route: LyricsRoute(), + route: const LyricsRoute(), icon: SpotubeIcons.music, title: l10n.lyrics, ), diff --git a/lib/components/adaptive/adaptive_pop_sheet_list.dart b/lib/components/adaptive/adaptive_pop_sheet_list.dart index 4f25dad1..6eba1148 100644 --- a/lib/components/adaptive/adaptive_pop_sheet_list.dart +++ b/lib/components/adaptive/adaptive_pop_sheet_list.dart @@ -146,7 +146,7 @@ class AdaptivePopSheetList extends StatelessWidget { return Tooltip( tooltip: TooltipContainer( child: Text(tooltip), - ), + ).call, child: IconButton( variance: variance, icon: icon ?? const Icon(SpotubeIcons.moreVertical), @@ -170,7 +170,7 @@ class AdaptivePopSheetList extends StatelessWidget { if (child != null) { return Tooltip( - tooltip: TooltipContainer(child: Text(tooltip)), + tooltip: TooltipContainer(child: Text(tooltip)).call, child: Button( onPressed: () => showDropdownMenu(context, Offset.zero), style: variance, @@ -180,7 +180,7 @@ class AdaptivePopSheetList extends StatelessWidget { } return Tooltip( - tooltip: TooltipContainer(child: Text(tooltip)), + tooltip: TooltipContainer(child: Text(tooltip)).call, child: IconButton( variance: variance, icon: icon ?? const Icon(SpotubeIcons.moreVertical), diff --git a/lib/components/expandable_search/expandable_search.dart b/lib/components/expandable_search/expandable_search.dart index 0c40b843..279a3e5f 100644 --- a/lib/components/expandable_search/expandable_search.dart +++ b/lib/components/expandable_search/expandable_search.dart @@ -40,7 +40,9 @@ class ExpandableSearchField extends StatelessWidget { focusNode: searchFocus, controller: searchController, placeholder: Text(context.l10n.search_tracks), - leading: const Icon(SpotubeIcons.search), + features: const [ + InputFeature.leading(Icon(SpotubeIcons.search)) + ], ), ), ), diff --git a/lib/components/form/text_form_field.dart b/lib/components/form/text_form_field.dart index 56ef34a5..3148b7b3 100644 --- a/lib/components/form/text_form_field.dart +++ b/lib/components/form/text_form_field.dart @@ -130,8 +130,10 @@ class TextFormBuilderField extends StatelessWidget { filled: filled, placeholder: placeholder, border: border, - leading: leading, - trailing: trailing, + features: [ + if (leading != null) InputFeature.leading(leading!), + if (trailing != null) InputFeature.trailing(trailing!), + ], padding: padding, onSubmitted: (value) { field.validate(); diff --git a/lib/components/heart_button/heart_button.dart b/lib/components/heart_button/heart_button.dart index 80fa077b..275d5db1 100644 --- a/lib/components/heart_button/heart_button.dart +++ b/lib/components/heart_button/heart_button.dart @@ -33,7 +33,7 @@ class HeartButton extends HookConsumerWidget { if (auth.asData?.value == null) return const SizedBox.shrink(); return Tooltip( - tooltip: TooltipContainer(child: Text(tooltip ?? "")), + tooltip: TooltipContainer(child: Text(tooltip ?? "")).call, child: IconButton( variance: variance, size: size, diff --git a/lib/components/playbutton_view/playbutton_card.dart b/lib/components/playbutton_view/playbutton_card.dart index 0b47ae28..ea28c738 100644 --- a/lib/components/playbutton_view/playbutton_card.dart +++ b/lib/components/playbutton_view/playbutton_card.dart @@ -151,7 +151,7 @@ class PlaybuttonCard extends StatelessWidget { ], ), title: Tooltip( - tooltip: TooltipContainer(child: Text(title)), + tooltip: TooltipContainer(child: Text(title)).call, child: Text( title, maxLines: 1, diff --git a/lib/components/playbutton_view/playbutton_tile.dart b/lib/components/playbutton_view/playbutton_tile.dart index ec1ca95f..7470105d 100644 --- a/lib/components/playbutton_view/playbutton_tile.dart +++ b/lib/components/playbutton_view/playbutton_tile.dart @@ -71,7 +71,7 @@ class PlaybuttonTile extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Tooltip( - tooltip: TooltipContainer(child: Text(context.l10n.add_to_queue)), + tooltip: TooltipContainer(child: Text(context.l10n.add_to_queue)).call, child: IconButton.outline( icon: const Icon(SpotubeIcons.queueAdd), onPressed: onAddToQueuePressed, @@ -80,7 +80,7 @@ class PlaybuttonTile extends StatelessWidget { ), const Gap(8), Tooltip( - tooltip: TooltipContainer(child: Text(context.l10n.play)), + tooltip: TooltipContainer(child: Text(context.l10n.play)).call, child: IconButton.secondary( icon: switch ((isLoading, isPlaying)) { (true, _) => const CircularProgressIndicator( diff --git a/lib/components/shimmers/shimmer_lyrics.dart b/lib/components/shimmers/shimmer_lyrics.dart index f8d29722..9312865e 100644 --- a/lib/components/shimmers/shimmer_lyrics.dart +++ b/lib/components/shimmers/shimmer_lyrics.dart @@ -1,6 +1,5 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:gap/gap.dart'; import 'package:skeletonizer/skeletonizer.dart'; diff --git a/lib/components/track_presentation/presentation_modifiers.dart b/lib/components/track_presentation/presentation_modifiers.dart index c46fef3f..42c3cb4f 100644 --- a/lib/components/track_presentation/presentation_modifiers.dart +++ b/lib/components/track_presentation/presentation_modifiers.dart @@ -67,10 +67,6 @@ class TrackPresentationModifiersSection extends HookConsumerWidget { child: TextField( controller: controller, focusNode: focusNode, - leading: Icon( - SpotubeIcons.search, - color: context.theme.colorScheme.mutedForeground, - ), placeholder: Text(context.l10n.search_tracks), onChanged: (value) { if (value.isEmpty) { @@ -79,30 +75,41 @@ class TrackPresentationModifiersSection extends HookConsumerWidget { notifier.filterTracks(value); } }, - trailing: ListenableBuilder( - listenable: controller, - builder: (context, _) { - return AnimatedCrossFade( - duration: const Duration(milliseconds: 300), - crossFadeState: controller.text.isEmpty - ? CrossFadeState.showFirst - : CrossFadeState.showSecond, - firstChild: - const SizedBox.square(dimension: 20), - secondChild: AnimatedScale( - duration: const Duration(milliseconds: 300), - scale: controller.text.isEmpty ? 0 : 1, - child: IconButton.ghost( - size: const ButtonSize(.6), - icon: const Icon(SpotubeIcons.close), - onPressed: () { - controller.clear(); - notifier.clearFilter(); - }, - ), - ), - ); - }), + features: [ + InputFeature.leading( + Icon( + SpotubeIcons.search, + color: context.theme.colorScheme.mutedForeground, + ), + ), + InputFeature.trailing( + ListenableBuilder( + listenable: controller, + builder: (context, _) { + return AnimatedCrossFade( + duration: const Duration(milliseconds: 300), + crossFadeState: controller.text.isEmpty + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + firstChild: + const SizedBox.square(dimension: 20), + secondChild: AnimatedScale( + duration: + const Duration(milliseconds: 300), + scale: controller.text.isEmpty ? 0 : 1, + child: IconButton.ghost( + size: const ButtonSize(.6), + icon: const Icon(SpotubeIcons.close), + onPressed: () { + controller.clear(); + notifier.clearFilter(); + }, + ), + ), + ); + }), + ) + ], ), ), ), diff --git a/lib/components/track_tile/track_options.dart b/lib/components/track_tile/track_options.dart index 949fcc8b..a0738165 100644 --- a/lib/components/track_tile/track_options.dart +++ b/lib/components/track_tile/track_options.dart @@ -474,7 +474,7 @@ class TrackOptions extends HookConsumerWidget { leading: Assets.logos.songlinkTransparent.image( width: 22, height: 22, - color: colorScheme.foreground.withOpacity(0.5), + color: colorScheme.foreground.withValues(alpha: 0.5), ), child: Text(context.l10n.song_link), ), diff --git a/lib/models/database/typeconverters/color.dart b/lib/models/database/typeconverters/color.dart index 70c27374..513921a2 100644 --- a/lib/models/database/typeconverters/color.dart +++ b/lib/models/database/typeconverters/color.dart @@ -10,7 +10,7 @@ class ColorConverter extends TypeConverter { @override int toSql(Color value) { - return value.value; + return value.toARGB32(); } } diff --git a/lib/modules/home/sections/feed.dart b/lib/modules/home/sections/feed.dart index d3e363cc..216dc491 100644 --- a/lib/modules/home/sections/feed.dart +++ b/lib/modules/home/sections/feed.dart @@ -12,7 +12,7 @@ class HomePageFeedSection extends HookConsumerWidget { @override Widget build(BuildContext context, ref) { final homeFeed = ref.watch(homeViewProvider); - final nonShortSections = homeFeed.asData?.value?.sections + final nonShortSections = homeFeed.asData?.value.sections .where((s) => s.typename == "HomeGenericSectionData") .toList() ?? []; diff --git a/lib/modules/library/playlist_generate/multi_select_field.dart b/lib/modules/library/playlist_generate/multi_select_field.dart index 7118d57d..00a09c95 100644 --- a/lib/modules/library/playlist_generate/multi_select_field.dart +++ b/lib/modules/library/playlist_generate/multi_select_field.dart @@ -68,7 +68,7 @@ class MultiSelectField extends HookWidget { side: BorderSide( color: enabled ? theme.colorScheme.onSurface - : theme.colorScheme.onSurface.withOpacity(0.1), + : theme.colorScheme.onSurface.withValues(alpha: 0.1), ), ), mouseCursor: WidgetStateMouseCursor.textable, diff --git a/lib/modules/library/playlist_generate/seeds_multi_autocomplete.dart b/lib/modules/library/playlist_generate/seeds_multi_autocomplete.dart index da1288f5..812d9367 100644 --- a/lib/modules/library/playlist_generate/seeds_multi_autocomplete.dart +++ b/lib/modules/library/playlist_generate/seeds_multi_autocomplete.dart @@ -119,8 +119,10 @@ class SeedsMultiAutocomplete extends HookWidget { focusNode: focusNode, onSubmitted: (_) => onFieldSubmitted(), enabled: enabled, - leading: leading, - trailing: trailing, + features: [ + if (leading != null) InputFeature.leading(leading!), + if (trailing != null) InputFeature.trailing(trailing!), + ], placeholder: placeholder, ); }, diff --git a/lib/modules/player/player_controls.dart b/lib/modules/player/player_controls.dart index e4c6ca7f..14b9cf43 100644 --- a/lib/modules/player/player_controls.dart +++ b/lib/modules/player/player_controls.dart @@ -89,7 +89,7 @@ class PlayerControls extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.slide_to_seek), - ), + ).call, child: SizedBox( width: mediaQuery.xlAndUp ? 600 : 500, child: Slider( @@ -147,7 +147,7 @@ class PlayerControls extends HookConsumerWidget { ? context.l10n.unshuffle_playlist : context.l10n.shuffle_playlist, ), - ), + ).call, child: IconButton( icon: Icon( SpotubeIcons.shuffle, @@ -170,7 +170,7 @@ class PlayerControls extends HookConsumerWidget { }), Tooltip( tooltip: TooltipContainer( - child: Text(context.l10n.previous_track)), + child: Text(context.l10n.previous_track)).call, child: IconButton.ghost( enabled: !isFetchingActiveTrack, icon: const Icon(SpotubeIcons.skipBack), @@ -184,7 +184,7 @@ class PlayerControls extends HookConsumerWidget { ? context.l10n.pause_playback : context.l10n.resume_playback, ), - ), + ).call, child: IconButton.primary( shape: ButtonShape.circle, icon: isFetchingActiveTrack @@ -206,7 +206,7 @@ class PlayerControls extends HookConsumerWidget { ), Tooltip( tooltip: - TooltipContainer(child: Text(context.l10n.next_track)), + TooltipContainer(child: Text(context.l10n.next_track)).call, child: IconButton.ghost( icon: const Icon(SpotubeIcons.skipForward), onPressed: @@ -226,7 +226,7 @@ class PlayerControls extends HookConsumerWidget { ? context.l10n.repeat_playlist : "", ), - ), + ).call, child: IconButton( icon: Icon( loopMode == PlaylistMode.single diff --git a/lib/modules/player/player_queue.dart b/lib/modules/player/player_queue.dart index 0ef86111..06d7e3c7 100644 --- a/lib/modules/player/player_queue.dart +++ b/lib/modules/player/player_queue.dart @@ -161,7 +161,7 @@ class PlayerQueue extends HookConsumerWidget { const SizedBox(width: 10), Tooltip( tooltip: TooltipContainer( - child: Text(context.l10n.clear_all)), + child: Text(context.l10n.clear_all)).call, child: IconButton.outline( icon: const Icon(SpotubeIcons.playlistRemove), onPressed: () { diff --git a/lib/modules/root/bottom_player.dart b/lib/modules/root/bottom_player.dart index 806d98e2..c2e6369d 100644 --- a/lib/modules/root/bottom_player.dart +++ b/lib/modules/root/bottom_player.dart @@ -76,7 +76,7 @@ class BottomPlayer extends HookConsumerWidget { extraActions: [ Tooltip( tooltip: - TooltipContainer(child: Text(context.l10n.mini_player)), + TooltipContainer(child: Text(context.l10n.mini_player)).call, child: IconButton( variance: ButtonVariance.ghost, icon: const Icon(SpotubeIcons.miniPlayer), diff --git a/lib/modules/root/sidebar/sidebar.dart b/lib/modules/root/sidebar/sidebar.dart index ea73a248..5e98d81f 100644 --- a/lib/modules/root/sidebar/sidebar.dart +++ b/lib/modules/root/sidebar/sidebar.dart @@ -71,7 +71,7 @@ class Sidebar extends HookConsumerWidget { NavigationButton( label: mediaQuery.lgAndUp ? Text(tile.title) : null, child: Tooltip( - tooltip: TooltipContainer(child: Text(tile.title)), + tooltip: TooltipContainer(child: Text(tile.title)).call, child: Icon(tile.icon), ), onPressed: () { @@ -88,7 +88,7 @@ class Sidebar extends HookConsumerWidget { context.navigateTo(tile.route); }, child: Tooltip( - tooltip: TooltipContainer(child: Text(tile.title)), + tooltip: TooltipContainer(child: Text(tile.title)).call, child: Icon(tile.icon), ), ), diff --git a/lib/modules/settings/color_scheme_picker_dialog.dart b/lib/modules/settings/color_scheme_picker_dialog.dart index 8092f825..3fb05e72 100644 --- a/lib/modules/settings/color_scheme_picker_dialog.dart +++ b/lib/modules/settings/color_scheme_picker_dialog.dart @@ -21,7 +21,7 @@ class SpotubeColor extends Color { @override String toString() { - return "$name:$value"; + return "$name:${toARGB32()}"; } } diff --git a/lib/pages/artist/section/footer.dart b/lib/pages/artist/section/footer.dart index 0fe2ab68..9a1423b5 100644 --- a/lib/pages/artist/section/footer.dart +++ b/lib/pages/artist/section/footer.dart @@ -35,7 +35,7 @@ class ArtistPageFooter extends ConsumerWidget { borderRadius: BorderRadius.circular(10), image: DecorationImage( colorFilter: ColorFilter.mode( - Colors.black.withOpacity(0.5), + Colors.black.withValues(alpha: 0.5), BlendMode.darken, ), image: UniversalImage.imageProvider( diff --git a/lib/pages/artist/section/header.dart b/lib/pages/artist/section/header.dart index 8a91f257..62e66edc 100644 --- a/lib/pages/artist/section/header.dart +++ b/lib/pages/artist/section/header.dart @@ -84,7 +84,7 @@ class ArtistPageHeader extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.add_artist_to_blacklist), - ), + ).call, child: IconButton( icon: Icon( SpotubeIcons.userRemove, diff --git a/lib/pages/connect/control/control.dart b/lib/pages/connect/control/control.dart index b75a135b..1c3e76c8 100644 --- a/lib/pages/connect/control/control.dart +++ b/lib/pages/connect/control/control.dart @@ -188,7 +188,7 @@ class ConnectControlPage extends HookConsumerWidget { ? context.l10n.unshuffle_playlist : context.l10n.shuffle_playlist, ), - ), + ).call, child: IconButton( icon: const Icon(SpotubeIcons.shuffle), variance: shuffled @@ -204,7 +204,7 @@ class ConnectControlPage extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.previous_track), - ), + ).call, child: IconButton.ghost( icon: const Icon(SpotubeIcons.skipBack), onPressed: playlist.activeTrack == null @@ -219,7 +219,7 @@ class ConnectControlPage extends HookConsumerWidget { ? context.l10n.pause_playback : context.l10n.resume_playback, ), - ), + ).call, child: IconButton.primary( shape: ButtonShape.circle, icon: playlist.activeTrack == null @@ -247,7 +247,7 @@ class ConnectControlPage extends HookConsumerWidget { ), Tooltip( tooltip: TooltipContainer( - child: Text(context.l10n.next_track)), + child: Text(context.l10n.next_track)).call, child: IconButton.ghost( icon: const Icon(SpotubeIcons.skipForward), onPressed: playlist.activeTrack == null @@ -264,7 +264,7 @@ class ConnectControlPage extends HookConsumerWidget { ? context.l10n.repeat_playlist : context.l10n.no_loop, ), - ), + ).call, child: IconButton( icon: Icon( loopMode == PlaylistMode.single diff --git a/lib/pages/lastfm_login/lastfm_login.dart b/lib/pages/lastfm_login/lastfm_login.dart index ca0f5693..164b9b0d 100644 --- a/lib/pages/lastfm_login/lastfm_login.dart +++ b/lib/pages/lastfm_login/lastfm_login.dart @@ -119,15 +119,19 @@ class LastFMLoginPage extends HookConsumerWidget { ], obscureText: !passwordVisible.value, placeholder: Text(context.l10n.password), - trailing: IconButton.ghost( - icon: Icon( - passwordVisible.value - ? SpotubeIcons.eye - : SpotubeIcons.noEye, + features: [ + InputFeature.trailing( + IconButton.ghost( + icon: Icon( + passwordVisible.value + ? SpotubeIcons.eye + : SpotubeIcons.noEye, + ), + onPressed: () => passwordVisible.value = + !passwordVisible.value, + ), ), - onPressed: () => passwordVisible.value = - !passwordVisible.value, - ), + ], ), ), ], diff --git a/lib/pages/library/user_albums.dart b/lib/pages/library/user_albums.dart index 60ba7319..beaa779f 100644 --- a/lib/pages/library/user_albums.dart +++ b/lib/pages/library/user_albums.dart @@ -75,7 +75,9 @@ class UserAlbumsPage extends HookConsumerWidget { height: 48, child: TextField( onChanged: (value) => searchText.value = value, - leading: const Icon(SpotubeIcons.filter), + features: const [ + InputFeature.leading(Icon(SpotubeIcons.filter)) + ], placeholder: Text(context.l10n.filter_artist), ), ), diff --git a/lib/pages/library/user_artists.dart b/lib/pages/library/user_artists.dart index 5f304f5e..35577cd7 100644 --- a/lib/pages/library/user_artists.dart +++ b/lib/pages/library/user_artists.dart @@ -80,7 +80,9 @@ class UserArtistsPage extends HookConsumerWidget { height: 48, child: TextField( onChanged: (value) => searchText.value = value, - leading: const Icon(SpotubeIcons.filter), + features: const [ + InputFeature.leading(Icon(SpotubeIcons.filter)), + ], placeholder: Text(context.l10n.filter_artist), ), ), diff --git a/lib/pages/library/user_playlists.dart b/lib/pages/library/user_playlists.dart index 8249726d..8b9e0dc3 100644 --- a/lib/pages/library/user_playlists.dart +++ b/lib/pages/library/user_playlists.dart @@ -99,7 +99,9 @@ class UserPlaylistsPage extends HookConsumerWidget { child: TextField( onChanged: (value) => searchText.value = value, placeholder: Text(context.l10n.filter_playlists), - leading: const Icon(SpotubeIcons.filter), + features: const [ + InputFeature.leading(Icon(SpotubeIcons.filter)), + ], ), ), ), diff --git a/lib/pages/lyrics/lyrics.dart b/lib/pages/lyrics/lyrics.dart index 5c6df2d2..1bd58d61 100644 --- a/lib/pages/lyrics/lyrics.dart +++ b/lib/pages/lyrics/lyrics.dart @@ -101,7 +101,7 @@ class LyricsPage extends HookConsumerWidget { borderRadius: BorderRadius.zero, borderWidth: 0, child: ColoredBox( - color: palette.color.withOpacity(.7), + color: palette.color.withValues(alpha: .7), child: SafeArea( child: IndexedStack( index: selectedIndex.value, diff --git a/lib/pages/lyrics/mini_lyrics.dart b/lib/pages/lyrics/mini_lyrics.dart index 58c2bc17..4c28eddd 100644 --- a/lib/pages/lyrics/mini_lyrics.dart +++ b/lib/pages/lyrics/mini_lyrics.dart @@ -59,7 +59,7 @@ class MiniLyricsPage extends HookConsumerWidget { areaActive.value = false; }, child: Scaffold( - backgroundColor: theme.colorScheme.background.withOpacity(0.4), + backgroundColor: theme.colorScheme.background.withValues(alpha: 0.4), headers: [ Padding( padding: const EdgeInsets.all(8.0), @@ -89,7 +89,8 @@ class MiniLyricsPage extends HookConsumerWidget { const Spacer(), Tooltip( tooltip: - TooltipContainer(child: Text(context.l10n.lyrics)), + TooltipContainer(child: Text(context.l10n.lyrics)) + .call, child: IconButton( variance: showLyrics.value ? ButtonVariance.secondary @@ -115,7 +116,7 @@ class MiniLyricsPage extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.show_hide_ui_on_hover), - ), + ).call, child: IconButton( variance: hoverMode.value ? ButtonVariance.secondary @@ -136,7 +137,7 @@ class MiniLyricsPage extends HookConsumerWidget { return Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.always_on_top), - ), + ).call, child: IconButton( variance: snapshot.data == true ? ButtonVariance.secondary @@ -199,7 +200,7 @@ class MiniLyricsPage extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.queue), - ), + ).call, child: IconButton.ghost( icon: const Icon(SpotubeIcons.queue), onPressed: playlistQueue.activeTrack != null @@ -245,7 +246,8 @@ class MiniLyricsPage extends HookConsumerWidget { const Flexible(child: PlayerControls(compact: true)), Tooltip( tooltip: TooltipContainer( - child: Text(context.l10n.exit_mini_player)), + child: Text(context.l10n.exit_mini_player)) + .call, child: IconButton.ghost( icon: const Icon(SpotubeIcons.maximize), onPressed: () async { @@ -268,7 +270,7 @@ class MiniLyricsPage extends HookConsumerWidget { const Duration(milliseconds: 200)); } finally { if (context.mounted) { - context.navigateTo(LyricsRoute()); + context.navigateTo(const LyricsRoute()); } } }, diff --git a/lib/pages/search/search.dart b/lib/pages/search/search.dart index eeedfb9c..3a338ea3 100644 --- a/lib/pages/search/search.dart +++ b/lib/pages/search/search.dart @@ -200,7 +200,7 @@ class SearchPage extends HookConsumerWidget { fontSize: 20, fontWeight: FontWeight.w900, color: theme.colorScheme.foreground - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), const SizedBox(height: 20), diff --git a/lib/pages/settings/sections/accounts.dart b/lib/pages/settings/sections/accounts.dart index 5e40b9ec..a381dc23 100644 --- a/lib/pages/settings/sections/accounts.dart +++ b/lib/pages/settings/sections/accounts.dart @@ -49,7 +49,7 @@ class SettingsAccountSection extends HookConsumerWidget { ), ), onTap: () { - context.navigateTo(ProfileRoute()); + context.navigateTo(const ProfileRoute()); }, ), if (auth.asData?.value == null) diff --git a/lib/pages/track/track.dart b/lib/pages/track/track.dart index 2918d1d7..8e6df748 100644 --- a/lib/pages/track/track.dart +++ b/lib/pages/track/track.dart @@ -77,7 +77,7 @@ class TrackPage extends HookConsumerWidget { ), fit: BoxFit.cover, colorFilter: ColorFilter.mode( - colorScheme.background.withOpacity(0.5), + colorScheme.background.withValues(alpha: 0.5), BlendMode.srcOver, ), alignment: Alignment.topCenter, @@ -196,7 +196,7 @@ class TrackPage extends HookConsumerWidget { Tooltip( tooltip: TooltipContainer( child: Text(context.l10n.play_next), - ), + ).call, child: IconButton.outline( icon: const Icon( SpotubeIcons.lightning), @@ -214,7 +214,7 @@ class TrackPage extends HookConsumerWidget { ? context.l10n.pause_playback : context.l10n.play, ), - ), + ).call, child: IconButton.primary( shape: ButtonShape.circle, icon: Icon( diff --git a/lib/provider/audio_player/audio_player_streams.dart b/lib/provider/audio_player/audio_player_streams.dart index 54c6d7cd..5892a428 100644 --- a/lib/provider/audio_player/audio_player_streams.dart +++ b/lib/provider/audio_player/audio_player_streams.dart @@ -63,7 +63,9 @@ class AudioPlayerStreamListeners { final currentSegments = await ref.read(segmentProvider.future); if (currentSegments?.segments.isNotEmpty != true || - position < const Duration(seconds: 3)) return; + position < const Duration(seconds: 3)) { + return; + } for (final segment in currentSegments!.segments) { final seconds = position.inSeconds; diff --git a/lib/provider/authentication/authentication.dart b/lib/provider/authentication/authentication.dart index 583955b0..497ccf79 100644 --- a/lib/provider/authentication/authentication.dart +++ b/lib/provider/authentication/authentication.dart @@ -61,7 +61,7 @@ class AuthenticationNotifier extends AsyncNotifier { Timer? refreshTimer; - ref.listenSelf((prevData, newData) async { + listenSelf((prevData, newData) async { if (newData.asData?.value == null) return; if (newData.asData!.value!.isExpired) { diff --git a/lib/provider/download_manager_provider.dart b/lib/provider/download_manager_provider.dart index 5e9eda20..1b588399 100644 --- a/lib/provider/download_manager_provider.dart +++ b/lib/provider/download_manager_provider.dart @@ -46,7 +46,9 @@ class DownloadManagerProvider extends ChangeNotifier { //? WebA audiotagging is not supported yet //? Although in future by converting weba to opus & then tagging it //? is possible using vorbis comments - downloadCodec == SourceCodecs.weba) return; + downloadCodec == SourceCodecs.weba) { + return; + } final file = File(request.path);