Skip to content

Commit

Permalink
feat: centralized icon collection with new icon set and nav bar label…
Browse files Browse the repository at this point in the history
…s hidden
  • Loading branch information
KRTirtho committed Jan 8, 2023
1 parent 6902060 commit e7acb9e
Show file tree
Hide file tree
Showing 32 changed files with 240 additions and 108 deletions.
9 changes: 5 additions & 4 deletions lib/collections/side_bar_tiles.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:spotube/collections/spotube_icons.dart';

class SideBarTiles {
final IconData icon;
Expand All @@ -7,8 +8,8 @@ class SideBarTiles {
}

List<SideBarTiles> sidebarTileList = [
SideBarTiles(icon: Icons.home_rounded, title: "Browse"),
SideBarTiles(icon: Icons.search_rounded, title: "Search"),
SideBarTiles(icon: Icons.library_books_rounded, title: "Library"),
SideBarTiles(icon: Icons.music_note_rounded, title: "Lyrics")
SideBarTiles(icon: SpotubeIcons.home, title: "Browse"),
SideBarTiles(icon: SpotubeIcons.search, title: "Search"),
SideBarTiles(icon: SpotubeIcons.library, title: "Library"),
SideBarTiles(icon: SpotubeIcons.music, title: "Lyrics")
];
61 changes: 61 additions & 0 deletions lib/collections/spotube_icons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';

abstract class SpotubeIcons {
static const home = FluentIcons.home;
static const search = FeatherIcons.search;
static const library = FluentIcons.library;
static const music = FeatherIcons.music;
static const play = FluentIcons.play;
static const pause = FeatherIcons.pause;
static const skipForward = FeatherIcons.skipForward;
static const skipBack = FeatherIcons.skipBack;
static const stop = FeatherIcons.square;
static const filter = FeatherIcons.filter;
static const refresh = FeatherIcons.refreshCw;
static const settings = FeatherIcons.settings;
static const shuffle = FeatherIcons.shuffle;
static const repeat = FluentIcons.repeat_all;
static const repeatOne = FluentIcons.repeat_one;
static const remove = FeatherIcons.minus;
static const removeFilled = FeatherIcons.minusCircle;
static const add = FeatherIcons.plus;
static const addFilled = FeatherIcons.plusSquare;
static const heart = FeatherIcons.heart;
static const heartFilled = Icons.favorite_rounded;
static const queue = Icons.queue_music_rounded;
static const download = FeatherIcons.download;
static const done = FeatherIcons.checkCircle;
static const alternativeRoute = Icons.alt_route_rounded;
static const sort = Icons.sort_rounded;
static const moreVertical = FeatherIcons.moreVertical;
static const moreHorizontal = FeatherIcons.moreHorizontal;
static const share = FeatherIcons.share2;
static const playlistAdd = Icons.playlist_add_rounded;
static const playlistRemove = Icons.playlist_remove_rounded;
static const trash = FeatherIcons.trash2;
static const clock = FeatherIcons.clock;
static const lyrics = Icons.lyrics_rounded;
static const logout = FeatherIcons.logOut;
static const login = FeatherIcons.logIn;
static const dashboard = FeatherIcons.grid;
static const darkMode = FeatherIcons.moon;
static const platform = FeatherIcons.smartphone;
static const palette = Icons.palette_outlined;
static const colorBucket = Icons.format_color_fill_rounded;
static const album = FeatherIcons.disc;
static const artist = FeatherIcons.user;
static const audioQuality = Icons.multitrack_audio_rounded;
static const fastForward = FeatherIcons.fastForward;
static const angleRight = FeatherIcons.chevronRight;
static const angleLeft = FeatherIcons.chevronLeft;
static const shoppingBag = FeatherIcons.shoppingBag;
static const screenSearch = Icons.screen_search_desktop_outlined;
static const save = FeatherIcons.save;
static const barChart = FeatherIcons.barChart2;
static const folder = FeatherIcons.folder;
static const update = FeatherIcons.refreshCcw;
static const info = FeatherIcons.info;
static const userRemove = FeatherIcons.userX;
}
3 changes: 2 additions & 1 deletion lib/components/library/user_albums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:collection/collection.dart';
import 'package:fuzzywuzzy/fuzzywuzzy.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/album/album_card.dart';
import 'package:spotube/components/shared/playbutton_card.dart';
import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart';
Expand Down Expand Up @@ -72,7 +73,7 @@ class UserAlbums extends HookConsumerWidget {
children: [
PlatformTextField(
onChanged: (value) => searchText.value = value,
prefixIcon: Icons.filter_alt_outlined,
prefixIcon: SpotubeIcons.filter,
placeholder: 'Filter Albums...',
),
const SizedBox(height: 20),
Expand Down
3 changes: 2 additions & 1 deletion lib/components/library/user_artists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:fuzzywuzzy/fuzzywuzzy.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/shared/fallbacks/anonymous_fallback.dart';
import 'package:spotube/components/shared/waypoint.dart';
import 'package:spotube/components/artist/artist_card.dart';
Expand Down Expand Up @@ -63,7 +64,7 @@ class UserArtists extends HookConsumerWidget {
color: PlatformTheme.of(context).scaffoldBackgroundColor!,
child: PlatformTextField(
onChanged: (value) => searchText.value = value,
prefixIcon: Icons.filter_alt_outlined,
prefixIcon: SpotubeIcons.filter,
placeholder: 'Filter artists...',
),
),
Expand Down
7 changes: 3 additions & 4 deletions lib/components/library/user_local_tracks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/shared/compact_search.dart';
import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart';
import 'package:spotube/components/shared/sort_tracks_dropdown.dart';
Expand Down Expand Up @@ -208,9 +209,7 @@ class UserLocalTracks extends HookConsumerWidget {
children: [
const Text("Play"),
Icon(
isPlaylistPlaying
? Icons.stop_rounded
: Icons.play_arrow_rounded,
isPlaylistPlaying ? SpotubeIcons.stop : SpotubeIcons.play,
)
],
),
Expand All @@ -226,7 +225,7 @@ class UserLocalTracks extends HookConsumerWidget {
),
const SizedBox(width: 10),
PlatformFilledButton(
child: const Icon(Icons.refresh_rounded),
child: const Icon(SpotubeIcons.refresh),
onPressed: () {
ref.refresh(localTracksProvider);
},
Expand Down
3 changes: 2 additions & 1 deletion lib/components/library/user_playlists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:collection/collection.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/playlist/playlist_create_dialog.dart';
import 'package:spotube/components/shared/playbutton_card.dart';
import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart';
Expand Down Expand Up @@ -99,7 +100,7 @@ class UserPlaylists extends HookConsumerWidget {
PlatformTextField(
onChanged: (value) => searchText.value = value,
placeholder: "Filter your playlists...",
prefixIcon: Icons.filter_alt_outlined,
prefixIcon: SpotubeIcons.filter,
),
const SizedBox(height: 20),
if (playlistsQuery.isLoading || !playlistsQuery.hasData)
Expand Down
6 changes: 3 additions & 3 deletions lib/components/lyrics/lyric_delay_adjust_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/root/sidebar.dart';
import 'package:spotube/pages/lyrics/synced_lyrics.dart';

Expand Down Expand Up @@ -80,7 +80,7 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
mainAxisSize: MainAxisSize.min,
children: [
PlatformIconButton(
icon: const Icon(Icons.remove_rounded),
icon: const Icon(SpotubeIcons.remove),
onPressed: () {
controller.text = "${getValue() - 25}ms";
},
Expand All @@ -100,7 +100,7 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
),
),
PlatformIconButton(
icon: const Icon(Icons.add_rounded),
icon: const Icon(SpotubeIcons.add),
onPressed: () {
controller.text = "${getValue() + 25}ms";
},
Expand Down
9 changes: 4 additions & 5 deletions lib/components/player/player_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/library/user_local_tracks.dart';
import 'package:spotube/components/player/player_queue.dart';
import 'package:spotube/components/player/sibling_tracks_sheet.dart';
Expand Down Expand Up @@ -53,7 +54,7 @@ class PlayerActions extends HookConsumerWidget {
mainAxisAlignment: mainAxisAlignment,
children: [
PlatformIconButton(
icon: const Icon(Icons.queue_music_rounded),
icon: const Icon(SpotubeIcons.queue),
tooltip: 'Queue',
onPressed: playback.playlist != null
? () {
Expand All @@ -79,7 +80,7 @@ class PlayerActions extends HookConsumerWidget {
),
if (!isLocalTrack)
PlatformIconButton(
icon: const Icon(Icons.alt_route_rounded),
icon: const Icon(SpotubeIcons.alternativeRoute),
tooltip: "Alternative Track Sources",
onPressed: playback.track != null
? () {
Expand Down Expand Up @@ -116,9 +117,7 @@ class PlayerActions extends HookConsumerWidget {
PlatformIconButton(
tooltip: 'Download track',
icon: Icon(
isDownloaded
? Icons.download_done_rounded
: Icons.download_rounded,
isDownloaded ? SpotubeIcons.done : SpotubeIcons.download,
),
onPressed: playback.track != null
? () => downloader.addToQueue(playback.track!)
Expand Down
17 changes: 9 additions & 8 deletions lib/components/player/player_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/hooks/playback_hooks.dart';
import 'package:spotube/collections/intents.dart';
import 'package:spotube/models/logger.dart';
Expand Down Expand Up @@ -143,7 +144,7 @@ class PlayerControls extends HookConsumerWidget {
? "Unshuffle playlist"
: "Shuffle playlist",
icon: Icon(
Icons.shuffle_rounded,
SpotubeIcons.shuffle,
color: playback.isShuffled
? PlatformTheme.of(context).primaryColor
: null,
Expand All @@ -157,7 +158,7 @@ class PlayerControls extends HookConsumerWidget {
PlatformIconButton(
tooltip: "Previous track",
icon: Icon(
Icons.skip_previous_rounded,
SpotubeIcons.skipBack,
color: iconColor,
),
onPressed: () {
Expand All @@ -175,8 +176,8 @@ class PlayerControls extends HookConsumerWidget {
)
: Icon(
playback.isPlaying
? Icons.pause_rounded
: Icons.play_arrow_rounded,
? SpotubeIcons.pause
: SpotubeIcons.play,
color: iconColor,
),
onPressed: Actions.handler<PlayPauseIntent>(
Expand All @@ -187,15 +188,15 @@ class PlayerControls extends HookConsumerWidget {
PlatformIconButton(
tooltip: "Next track",
icon: Icon(
Icons.skip_next_rounded,
SpotubeIcons.skipForward,
color: iconColor,
),
onPressed: () => onNext(),
),
PlatformIconButton(
tooltip: "Stop playback",
icon: Icon(
Icons.stop_rounded,
SpotubeIcons.stop,
color: iconColor,
),
onPressed: playback.track != null
Expand All @@ -213,8 +214,8 @@ class PlayerControls extends HookConsumerWidget {
!playback.isLoop ? "Loop Track" : "Repeat playlist",
icon: Icon(
playback.isLoop
? Icons.repeat_one_rounded
: Icons.repeat_rounded,
? SpotubeIcons.repeatOne
: SpotubeIcons.repeat,
),
onPressed:
playback.track == null || playback.playlist == null
Expand Down
9 changes: 5 additions & 4 deletions lib/components/player/player_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/player/player_track_details.dart';
import 'package:spotube/hooks/playback_hooks.dart';
import 'package:spotube/hooks/use_palette_color.dart';
Expand Down Expand Up @@ -83,7 +84,7 @@ class PlayerOverlay extends HookConsumerWidget {
children: [
IconButton(
icon: Icon(
Icons.skip_previous_rounded,
SpotubeIcons.skipBack,
color: paletteColor.bodyTextColor,
),
onPressed: () {
Expand All @@ -94,8 +95,8 @@ class PlayerOverlay extends HookConsumerWidget {
return IconButton(
icon: Icon(
ref.read(playbackProvider).isPlaying
? Icons.pause_rounded
: Icons.play_arrow_rounded,
? SpotubeIcons.pause
: SpotubeIcons.play,
color: paletteColor.bodyTextColor,
),
onPressed: Actions.handler<PlayPauseIntent>(
Expand All @@ -107,7 +108,7 @@ class PlayerOverlay extends HookConsumerWidget {
),
IconButton(
icon: Icon(
Icons.skip_next_rounded,
SpotubeIcons.skipForward,
color: paletteColor.bodyTextColor,
),
onPressed: () => onNext(),
Expand Down
3 changes: 2 additions & 1 deletion lib/components/playlist/playlist_create_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/root/sidebar.dart';
import 'package:spotube/provider/spotify_provider.dart';
import 'package:spotube/services/queries/queries.dart';
Expand Down Expand Up @@ -138,7 +139,7 @@ class PlaylistCreateDialog extends HookConsumerWidget {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(Icons.add_box_rounded, size: 40),
Icon(SpotubeIcons.addFilled, size: 40),
PlatformText("Create Playlist", style: TextStyle(fontSize: 20)),
],
),
Expand Down
7 changes: 3 additions & 4 deletions lib/components/root/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter/material.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/side_bar_tiles.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/shared/image/universal_image.dart';
import 'package:spotube/hooks/use_breakpoints.dart';
import 'package:spotube/provider/auth_provider.dart';
Expand Down Expand Up @@ -175,7 +176,7 @@ class Sidebar extends HookConsumerWidget {
),
windowsFooterItems: [
fluent_ui.PaneItemAction(
icon: const fluent_ui.Icon(fluent_ui.FluentIcons.settings),
icon: const Icon(SpotubeIcons.settings),
onTap: () => goToSettings(context),
),
],
Expand All @@ -192,8 +193,6 @@ class SidebarFooter extends HookConsumerWidget {

@override
Widget build(BuildContext context, ref) {
final auth = ref.watch(authProvider);

return SizedBox(
width: 256,
child: HookBuilder(
Expand Down Expand Up @@ -268,7 +267,7 @@ class SidebarFooter extends HookConsumerWidget {
),
),
PlatformIconButton(
icon: const Icon(Icons.settings_outlined),
icon: const Icon(SpotubeIcons.settings),
onPressed: () => Sidebar.goToSettings(context)),
],
));
Expand Down
3 changes: 2 additions & 1 deletion lib/components/root/spotube_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/collections/side_bar_tiles.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/root/sidebar.dart';
import 'package:spotube/hooks/use_breakpoints.dart';
import 'package:spotube/provider/downloader_provider.dart';
Expand Down Expand Up @@ -48,7 +49,7 @@ class SpotubeNavigationBar extends HookConsumerWidget {
},
),
const PlatformBottomNavigationBarItem(
icon: Icons.settings_rounded,
icon: SpotubeIcons.settings,
label: "Settings",
)
],
Expand Down
Loading

0 comments on commit e7acb9e

Please sign in to comment.