From 7c25e1cc8a35eb8aee2268799c05f299204fa3f5 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 8 Dec 2022 11:43:31 +0600 Subject: [PATCH] feat: rename files to snake_case and reorganize folder structure --- .../cache_keys.dart} | 0 .../Intents.dart => collections/intents.dart} | 8 +- .../routes.dart} | 49 +++--- .../side_bar_tiles.dart} | 0 .../spotify_markets.dart} | 0 .../AlbumCard.dart => album/album_card.dart} | 10 +- .../artist_album_list.dart} | 10 +- .../artist_card.dart} | 6 +- .../login_form.dart} | 2 +- .../category_card.dart} | 10 +- .../user_albums.dart} | 10 +- .../user_artists.dart} | 10 +- .../user_downloads.dart} | 4 +- .../user_local_tracks.dart} | 16 +- .../user_playlists.dart} | 12 +- .../lyric_delay_adjust_dialog.dart} | 4 +- .../player_actions.dart} | 14 +- .../player_controls.dart} | 8 +- .../player_overlay.dart} | 10 +- .../player_queue.dart} | 8 +- .../player_track_details.dart} | 6 +- .../sibling_tracks_sheet.dart} | 4 +- .../playlist_card.dart} | 10 +- .../playlist_create_dialog.dart} | 4 +- .../playlist_genre_view.dart} | 6 +- .../Player.dart => root/bottom_player.dart} | 18 +-- .../{Home/Sidebar.dart => root/sidebar.dart} | 14 +- .../spotube_navigation_bar.dart} | 10 +- .../color_scheme_picker_dialog.dart} | 4 +- .../adaptive/adaptive_list_tile.dart} | 4 +- .../adaptive/adaptive_popup_menu_button.dart} | 2 +- .../colored_tab_bar.dart} | 0 .../dialogs/confirm_download_dialog.dart} | 8 +- .../dialogs/playlist_add_track_dialog.dart} | 6 +- .../dialogs/replace_downloaded_dialog.dart} | 6 +- .../fallbacks/anonymous_fallback.dart} | 2 +- .../fallbacks/not_found.dart} | 0 .../heart_button.dart} | 6 +- .../hover_builder.dart} | 0 .../image/universal_image.dart} | 0 .../links/anchor_button.dart} | 0 .../links/hyper_link.dart} | 2 +- .../links/link_text.dart} | 2 +- .../page_window_title_bar.dart} | 0 .../playbutton_card.dart} | 8 +- .../shimmers/shimmer_artist_profile.dart} | 6 +- .../shimmers/shimmer_categories.dart} | 5 +- .../shimmers/shimmer_lyrics.dart} | 4 +- .../shimmers/shimmer_playbutton_card.dart} | 2 +- .../shimmers/shimmer_track_tile.dart} | 2 +- .../sort_tracks_dropdown.dart} | 2 +- .../spotube_marquee_text.dart} | 0 .../spotube_page_route.dart} | 0 .../track_table/track_collection_view.dart} | 14 +- .../track_table/track_tile.dart} | 20 +-- .../track_table/tracks_table_view.dart} | 22 +-- .../Waypoint.dart => shared/waypoint.dart} | 0 lib/extensions/album_simple.dart | 18 +++ lib/extensions/artist_simple.dart | 13 ++ .../{list-sort-multiple.dart => list.dart} | 0 .../{ShimmerColorTheme.dart => theme.dart} | 0 lib/extensions/track.dart | 29 ++++ ...video-from-cache-track.dart => video.dart} | 0 .../{playback.dart => playback_hooks.dart} | 4 +- ...AsyncEffect.dart => use_async_effect.dart} | 0 ...r.dart => use_auto_scroll_controller.dart} | 0 ...ntValue.dart => use_breakpoint_value.dart} | 2 +- ...eBreakpoints.dart => use_breakpoints.dart} | 0 ....dart => use_custom_status_bar_color.dart} | 0 ...ForceUpdate.dart => use_force_update.dart} | 0 ...ntRoute.dart => use_is_current_route.dart} | 0 ...PackageInfo.dart => use_package_info.dart} | 0 ...letteColor.dart => use_palette_color.dart} | 2 +- ...operty.dart => use_platform_property.dart} | 0 ...ences.dart => use_shared_preferences.dart} | 0 ...ncedLyrics.dart => use_synced_lyrics.dart} | 2 +- ...teChecker.dart => use_update_checker.dart} | 8 +- lib/main.dart | 145 +++++++++--------- ...entPlaylist.dart => current_playlist.dart} | 58 +------ lib/models/{Logger.dart => logger.dart} | 0 lib/models/{LyricsModels.dart => lyrics.dart} | 0 ....dart => spotify_spotube_credentials.dart} | 0 .../{SpotubeTrack.dart => spotube_track.dart} | 5 +- .../AlbumView.dart => pages/album/album.dart} | 18 +-- .../artist/artist.dart} | 30 ++-- .../desktop_login/desktop_login.dart} | 10 +- .../desktop_login/login_tutorial.dart} | 8 +- .../Genres.dart => pages/genre/genres.dart} | 16 +- .../library/library.dart} | 16 +- .../lyrics/genius_lyrics.dart} | 8 +- .../Lyrics.dart => pages/lyrics/lyrics.dart} | 18 +-- .../lyrics/synced_lyrics.dart} | 14 +- .../mobile_login/mobile_login.dart} | 2 +- .../player/player.dart} | 20 +-- .../playlist/playlist.dart} | 16 +- .../Shell.dart => pages/root/root_app.dart} | 20 ++- .../Search.dart => pages/search/search.dart} | 30 ++-- .../About.dart => pages/settings/about.dart} | 4 +- .../settings/settings.dart} | 24 +-- lib/provider/SpotifyRequests.dart | 4 +- ...Player.dart => audio_player_provider.dart} | 0 .../{Auth.dart => auth_provider.dart} | 2 +- .../{DBus.dart => dbus_provider.dart} | 0 ...wnloader.dart => downloader_provider.dart} | 13 +- .../{Playback.dart => playback_provider.dart} | 22 +-- .../{SpotifyDI.dart => spotify_provider.dart} | 2 +- ...es.dart => user_preferences_provider.dart} | 8 +- .../{YouTube.dart => youtube_provider.dart} | 0 ...oService.dart => linux_audio_service.dart} | 6 +- ...Service.dart => mobile_audio_service.dart} | 2 +- .../{dark-theme.dart => dark_theme.dart} | 2 +- .../{light-theme.dart => light_theme.dart} | 2 +- ...er.dart => persisted_change_notifier.dart} | 0 lib/utils/service_utils.dart | 10 +- lib/utils/type_conversion_utils.dart | 4 +- 115 files changed, 505 insertions(+), 502 deletions(-) rename lib/{models/LocalStorageKeys.dart => collections/cache_keys.dart} (100%) rename lib/{models/Intents.dart => collections/intents.dart} (94%) rename lib/{models/GoRouteDeclarations.dart => collections/routes.dart} (59%) rename lib/{models/sideBarTiles.dart => collections/side_bar_tiles.dart} (100%) rename lib/{models/SpotifyMarkets.dart => collections/spotify_markets.dart} (100%) rename lib/components/{Album/AlbumCard.dart => album/album_card.dart} (87%) rename lib/components/{Artist/ArtistAlbumList.dart => artist/artist_album_list.dart} (87%) rename lib/components/{Artist/ArtistCard.dart => artist/artist_card.dart} (96%) rename lib/components/{Login/TokenLoginForms.dart => desktop_login/login_form.dart} (97%) rename lib/components/{Category/CategoryCard.dart => genre/category_card.dart} (90%) rename lib/components/{Library/UserAlbums.dart => library/user_albums.dart} (82%) rename lib/components/{Library/UserArtists.dart => library/user_artists.dart} (87%) rename lib/components/{Library/UserDownloads.dart => library/user_downloads.dart} (95%) rename lib/components/{Library/UserLocalTracks.dart => library/user_local_tracks.dart} (93%) rename lib/components/{Library/UserPlaylists.dart => library/user_playlists.dart} (83%) rename lib/components/{Lyrics/LyricDelayAdjustDialog.dart => lyrics/lyric_delay_adjust_dialog.dart} (95%) rename lib/components/{Player/PlayerActions.dart => player/player_actions.dart} (91%) rename lib/components/{Player/PlayerControls.dart => player/player_controls.dart} (97%) rename lib/components/{Player/PlayerOverlay.dart => player/player_overlay.dart} (93%) rename lib/components/{Player/PlayerQueue.dart => player/player_queue.dart} (93%) rename lib/components/{Player/PlayerTrackDetails.dart => player/player_track_details.dart} (91%) rename lib/components/{Player/SiblingTracksSheet.dart => player/sibling_tracks_sheet.dart} (96%) rename lib/components/{Playlist/PlaylistCard.dart => playlist/playlist_card.dart} (88%) rename lib/components/{Playlist/PlaylistCreateDialog.dart => playlist/playlist_create_dialog.dart} (97%) rename lib/components/{Playlist/PlaylistGenreView.dart => playlist/playlist_genre_view.dart} (92%) rename lib/components/{Player/Player.dart => root/bottom_player.dart} (91%) rename lib/components/{Home/Sidebar.dart => root/sidebar.dart} (95%) rename lib/components/{Home/SpotubeNavigationBar.dart => root/spotube_navigation_bar.dart} (86%) rename lib/components/{Settings/ColorSchemePickerDialog.dart => settings/color_scheme_picker_dialog.dart} (97%) rename lib/components/{Shared/AdaptiveListTile.dart => shared/adaptive/adaptive_list_tile.dart} (94%) rename lib/components/{Shared/AdaptivePopupMenuButton.dart => shared/adaptive/adaptive_popup_menu_button.dart} (98%) rename lib/components/{Shared/ColoredTabBar.dart => shared/colored_tab_bar.dart} (100%) rename lib/components/{Shared/DownloadConfirmationDialog.dart => shared/dialogs/confirm_download_dialog.dart} (93%) rename lib/components/{Shared/AddTracksToPlaylistDialog.dart => shared/dialogs/playlist_add_track_dialog.dart} (95%) rename lib/components/{Shared/ReplaceDownloadedFileDialog.dart => shared/dialogs/replace_downloaded_dialog.dart} (92%) rename lib/components/{Shared/AnonymousFallback.dart => shared/fallbacks/anonymous_fallback.dart} (94%) rename lib/components/{Shared/NotFound.dart => shared/fallbacks/not_found.dart} (100%) rename lib/components/{Shared/HeartButton.dart => shared/heart_button.dart} (97%) rename lib/components/{Shared/HoverBuilder.dart => shared/hover_builder.dart} (100%) rename lib/components/{Shared/UniversalImage.dart => shared/image/universal_image.dart} (100%) rename lib/components/{Shared/AnchorButton.dart => shared/links/anchor_button.dart} (100%) rename lib/components/{Shared/Hyperlink.dart => shared/links/hyper_link.dart} (91%) rename lib/components/{Shared/LinkText.dart => shared/links/link_text.dart} (91%) rename lib/components/{Shared/PageWindowTitleBar.dart => shared/page_window_title_bar.dart} (100%) rename lib/components/{Shared/PlaybuttonCard.dart => shared/playbutton_card.dart} (96%) rename lib/components/{LoaderShimmers/ShimmerArtistProfile.dart => shared/shimmers/shimmer_artist_profile.dart} (89%) rename lib/components/{LoaderShimmers/ShimmerCategories.dart => shared/shimmers/shimmer_categories.dart} (86%) rename lib/components/{LoaderShimmers/ShimmerLyrics.dart => shared/shimmers/shimmer_lyrics.dart} (94%) rename lib/components/{LoaderShimmers/ShimmerPlaybuttonCard.dart => shared/shimmers/shimmer_playbutton_card.dart} (98%) rename lib/components/{LoaderShimmers/ShimmerTrackTile.dart => shared/shimmers/shimmer_track_tile.dart} (97%) rename lib/components/{Shared/SortTracksDropdown.dart => shared/sort_tracks_dropdown.dart} (95%) rename lib/components/{Shared/SpotubeMarqueeText.dart => shared/spotube_marquee_text.dart} (100%) rename lib/components/{Shared/SpotubePageRoute.dart => shared/spotube_page_route.dart} (100%) rename lib/components/{Shared/TrackCollectionView.dart => shared/track_table/track_collection_view.dart} (95%) rename lib/components/{Shared/TrackTile.dart => shared/track_table/track_tile.dart} (95%) rename lib/components/{Shared/TracksTableView.dart => shared/track_table/tracks_table_view.dart} (92%) rename lib/components/{Shared/Waypoint.dart => shared/waypoint.dart} (100%) create mode 100644 lib/extensions/album_simple.dart create mode 100644 lib/extensions/artist_simple.dart rename lib/extensions/{list-sort-multiple.dart => list.dart} (100%) rename lib/extensions/{ShimmerColorTheme.dart => theme.dart} (100%) create mode 100644 lib/extensions/track.dart rename lib/extensions/{yt-video-from-cache-track.dart => video.dart} (100%) rename lib/hooks/{playback.dart => playback_hooks.dart} (88%) rename lib/hooks/{useAsyncEffect.dart => use_async_effect.dart} (100%) rename lib/hooks/{useAutoScrollController.dart => use_auto_scroll_controller.dart} (100%) rename lib/hooks/{useBreakpointValue.dart => use_breakpoint_value.dart} (84%) rename lib/hooks/{useBreakpoints.dart => use_breakpoints.dart} (100%) rename lib/hooks/{useCustomStatusBarColor.dart => use_custom_status_bar_color.dart} (100%) rename lib/hooks/{useForceUpdate.dart => use_force_update.dart} (100%) rename lib/hooks/{useIsCurrentRoute.dart => use_is_current_route.dart} (100%) rename lib/hooks/{usePackageInfo.dart => use_package_info.dart} (100%) rename lib/hooks/{usePaletteColor.dart => use_palette_color.dart} (96%) rename lib/hooks/{usePlatformProperty.dart => use_platform_property.dart} (100%) rename lib/hooks/{useSharedPreferences.dart => use_shared_preferences.dart} (100%) rename lib/hooks/{useSyncedLyrics.dart => use_synced_lyrics.dart} (91%) rename lib/hooks/{useUpdateChecker.dart => use_update_checker.dart} (92%) rename lib/models/{CurrentPlaylist.dart => current_playlist.dart} (56%) rename lib/models/{Logger.dart => logger.dart} (100%) rename lib/models/{LyricsModels.dart => lyrics.dart} (100%) rename lib/models/{SpotifySpotubeCredentials.dart => spotify_spotube_credentials.dart} (100%) rename lib/models/{SpotubeTrack.dart => spotube_track.dart} (93%) rename lib/{components/Album/AlbumView.dart => pages/album/album.dart} (85%) rename lib/{components/Artist/ArtistProfile.dart => pages/artist/artist.dart} (94%) rename lib/{components/Login/TokenLogin.dart => pages/desktop_login/desktop_login.dart} (89%) rename lib/{components/Login/LoginTutorial.dart => pages/desktop_login/login_tutorial.dart} (93%) rename lib/{components/Home/Genres.dart => pages/genre/genres.dart} (80%) rename lib/{components/Library/UserLibrary.dart => pages/library/library.dart} (74%) rename lib/{components/Lyrics/GeniusLyrics.dart => pages/lyrics/genius_lyrics.dart} (93%) rename lib/{components/Lyrics/Lyrics.dart => pages/lyrics/lyrics.dart} (82%) rename lib/{components/Lyrics/SyncedLyrics.dart => pages/lyrics/synced_lyrics.dart} (92%) rename lib/{components/Login/WebViewLogin.dart => pages/mobile_login/mobile_login.dart} (98%) rename lib/{components/Player/PlayerView.dart => pages/player/player.dart} (92%) rename lib/{components/Playlist/PlaylistView.dart => pages/playlist/playlist.dart} (89%) rename lib/{components/Home/Shell.dart => pages/root/root_app.dart} (78%) rename lib/{components/Search/Search.dart => pages/search/search.dart} (95%) rename lib/{components/Settings/About.dart => pages/settings/about.dart} (97%) rename lib/{components/Settings/Settings.dart => pages/settings/settings.dart} (97%) rename lib/provider/{AudioPlayer.dart => audio_player_provider.dart} (100%) rename lib/provider/{Auth.dart => auth_provider.dart} (98%) rename lib/provider/{DBus.dart => dbus_provider.dart} (100%) rename lib/provider/{Downloader.dart => downloader_provider.dart} (93%) rename lib/provider/{Playback.dart => playback_provider.dart} (97%) rename lib/provider/{SpotifyDI.dart => spotify_provider.dart} (91%) rename lib/provider/{UserPreferences.dart => user_preferences_provider.dart} (96%) rename lib/provider/{YouTube.dart => youtube_provider.dart} (100%) rename lib/services/{LinuxAudioService.dart => linux_audio_service.dart} (99%) rename lib/services/{MobileAudioService.dart => mobile_audio_service.dart} (97%) rename lib/themes/{dark-theme.dart => dark_theme.dart} (98%) rename lib/themes/{light-theme.dart => light_theme.dart} (98%) rename lib/utils/{PersistedChangeNotifier.dart => persisted_change_notifier.dart} (100%) diff --git a/lib/models/LocalStorageKeys.dart b/lib/collections/cache_keys.dart similarity index 100% rename from lib/models/LocalStorageKeys.dart rename to lib/collections/cache_keys.dart diff --git a/lib/models/Intents.dart b/lib/collections/intents.dart similarity index 94% rename from lib/models/Intents.dart rename to lib/collections/intents.dart index 3c0010c1d..e8c8679aa 100644 --- a/lib/models/Intents.dart +++ b/lib/collections/intents.dart @@ -4,10 +4,10 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Player/PlayerControls.dart'; -import 'package:spotube/models/GoRouteDeclarations.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/player/player_controls.dart'; +import 'package:spotube/collections/routes.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/platform.dart'; class PlayPauseIntent extends Intent { diff --git a/lib/models/GoRouteDeclarations.dart b/lib/collections/routes.dart similarity index 59% rename from lib/models/GoRouteDeclarations.dart rename to lib/collections/routes.dart index bd4e5b958..ebd1e3b21 100644 --- a/lib/models/GoRouteDeclarations.dart +++ b/lib/collections/routes.dart @@ -1,21 +1,21 @@ import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; import 'package:spotify/spotify.dart' hide Search; -import 'package:spotube/components/Album/AlbumView.dart'; -import 'package:spotube/components/Artist/ArtistProfile.dart'; -import 'package:spotube/components/Home/Genres.dart'; -import 'package:spotube/components/Home/Shell.dart'; -import 'package:spotube/components/Library/UserLibrary.dart'; -import 'package:spotube/components/Login/LoginTutorial.dart'; -import 'package:spotube/components/Login/TokenLogin.dart'; -import 'package:spotube/components/Lyrics/Lyrics.dart'; -import 'package:spotube/components/Player/PlayerView.dart'; -import 'package:spotube/components/Playlist/PlaylistView.dart'; -import 'package:spotube/components/Search/Search.dart'; -import 'package:spotube/components/Settings/Settings.dart'; -import 'package:spotube/components/Shared/SpotubePageRoute.dart'; +import 'package:spotube/pages/album/album.dart'; +import 'package:spotube/pages/artist/artist.dart'; +import 'package:spotube/pages/genre/genres.dart'; +import 'package:spotube/pages/library/library.dart'; +import 'package:spotube/pages/desktop_login/login_tutorial.dart'; +import 'package:spotube/pages/desktop_login/desktop_login.dart'; +import 'package:spotube/pages/lyrics/lyrics.dart'; +import 'package:spotube/pages/player/player.dart'; +import 'package:spotube/pages/playlist/playlist.dart'; +import 'package:spotube/pages/root/root_app.dart'; +import 'package:spotube/pages/search/search.dart'; +import 'package:spotube/components/shared/spotube_page_route.dart'; +import 'package:spotube/pages/settings/settings.dart'; import 'package:spotube/utils/platform.dart'; -import 'package:spotube/components/Login/WebViewLogin.dart'; +import 'package:spotube/pages/mobile_login/mobile_login.dart'; final rootNavigatorKey = GlobalKey(); final shellRouteNavigatorKey = GlobalKey(); @@ -24,46 +24,49 @@ final router = GoRouter( routes: [ ShellRoute( navigatorKey: shellRouteNavigatorKey, - builder: (context, state, child) => Shell(child: child), + builder: (context, state, child) => RootApp(child: child), routes: [ GoRoute( path: "/", - pageBuilder: (context, state) => SpotubePage(child: const Genres()), + pageBuilder: (context, state) => + SpotubePage(child: const GenrePage()), ), GoRoute( path: "/search", name: "Search", - pageBuilder: (context, state) => SpotubePage(child: const Search()), + pageBuilder: (context, state) => + SpotubePage(child: const SearchPage()), ), GoRoute( path: "/library", name: "Library", pageBuilder: (context, state) => - SpotubePage(child: const UserLibrary()), + SpotubePage(child: const LibraryPage()), ), GoRoute( path: "/lyrics", name: "Lyrics", - pageBuilder: (context, state) => SpotubePage(child: const Lyrics()), + pageBuilder: (context, state) => + SpotubePage(child: const LyricsPage()), ), GoRoute( path: "/settings", pageBuilder: (context, state) => SpotubePage( - child: const Settings(), + child: const SettingsPage(), ), ), GoRoute( path: "/album/:id", pageBuilder: (context, state) { assert(state.extra is AlbumSimple); - return SpotubePage(child: AlbumView(state.extra as AlbumSimple)); + return SpotubePage(child: AlbumPage(state.extra as AlbumSimple)); }, ), GoRoute( path: "/artist/:id", pageBuilder: (context, state) { assert(state.params["id"] != null); - return SpotubePage(child: ArtistProfile(state.params["id"]!)); + return SpotubePage(child: ArtistPage(state.params["id"]!)); }, ), GoRoute( @@ -81,7 +84,7 @@ final router = GoRouter( path: "/login", parentNavigatorKey: rootNavigatorKey, pageBuilder: (context, state) => SpotubePage( - child: kIsMobile ? const WebViewLogin() : const TokenLogin(), + child: kIsMobile ? const WebViewLogin() : const DesktopLoginPage(), ), ), GoRoute( diff --git a/lib/models/sideBarTiles.dart b/lib/collections/side_bar_tiles.dart similarity index 100% rename from lib/models/sideBarTiles.dart rename to lib/collections/side_bar_tiles.dart diff --git a/lib/models/SpotifyMarkets.dart b/lib/collections/spotify_markets.dart similarity index 100% rename from lib/models/SpotifyMarkets.dart rename to lib/collections/spotify_markets.dart diff --git a/lib/components/Album/AlbumCard.dart b/lib/components/album/album_card.dart similarity index 87% rename from lib/components/Album/AlbumCard.dart rename to lib/components/album/album_card.dart index 0e479fcca..c661e2dac 100644 --- a/lib/components/Album/AlbumCard.dart +++ b/lib/components/album/album_card.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Shared/PlaybuttonCard.dart'; -import 'package:spotube/hooks/useBreakpointValue.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/playbutton_card.dart'; +import 'package:spotube/hooks/use_breakpoint_value.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Artist/ArtistAlbumList.dart b/lib/components/artist/artist_album_list.dart similarity index 87% rename from lib/components/Artist/ArtistAlbumList.dart rename to lib/components/artist/artist_album_list.dart index 4791d5714..564c3405a 100644 --- a/lib/components/Artist/ArtistAlbumList.dart +++ b/lib/components/artist/artist_album_list.dart @@ -4,11 +4,11 @@ import 'package:flutter/material.dart' hide Page; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Album/AlbumCard.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/components/Shared/Waypoint.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/album/album_card.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/components/shared/waypoint.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; class ArtistAlbumList extends HookConsumerWidget { diff --git a/lib/components/Artist/ArtistCard.dart b/lib/components/artist/artist_card.dart similarity index 96% rename from lib/components/Artist/ArtistCard.dart rename to lib/components/artist/artist_card.dart index bf8784b3e..22bfc04a4 100644 --- a/lib/components/Artist/ArtistCard.dart +++ b/lib/components/artist/artist_card.dart @@ -4,9 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Shared/HoverBuilder.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/usePlatformProperty.dart'; +import 'package:spotube/components/shared/hover_builder.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_platform_property.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Login/TokenLoginForms.dart b/lib/components/desktop_login/login_form.dart similarity index 97% rename from lib/components/Login/TokenLoginForms.dart rename to lib/components/desktop_login/login_form.dart index 85f7c77d7..e138ef6ab 100644 --- a/lib/components/Login/TokenLoginForms.dart +++ b/lib/components/desktop_login/login_form.dart @@ -2,7 +2,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/provider/Auth.dart'; +import 'package:spotube/provider/auth_provider.dart'; import 'package:spotube/utils/service_utils.dart'; class TokenLoginForm extends HookConsumerWidget { diff --git a/lib/components/Category/CategoryCard.dart b/lib/components/genre/category_card.dart similarity index 90% rename from lib/components/Category/CategoryCard.dart rename to lib/components/genre/category_card.dart index bddc2169c..6add9e052 100644 --- a/lib/components/Category/CategoryCard.dart +++ b/lib/components/genre/category_card.dart @@ -5,11 +5,11 @@ 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/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/components/Playlist/PlaylistCard.dart'; -import 'package:spotube/components/Shared/Waypoint.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/components/shared/waypoint.dart'; +import 'package:spotube/components/playlist/playlist_card.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; class CategoryCard extends HookConsumerWidget { diff --git a/lib/components/Library/UserAlbums.dart b/lib/components/library/user_albums.dart similarity index 82% rename from lib/components/Library/UserAlbums.dart rename to lib/components/library/user_albums.dart index 30c7f4ca7..6c9e0bd1c 100644 --- a/lib/components/Library/UserAlbums.dart +++ b/lib/components/library/user_albums.dart @@ -2,11 +2,11 @@ import 'package:fl_query_hooks/fl_query_hooks.dart'; import 'package:flutter/material.dart' hide Image; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Album/AlbumCard.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/components/Shared/AnonymousFallback.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/album/album_card.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/components/shared/fallbacks/anonymous_fallback.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Library/UserArtists.dart b/lib/components/library/user_artists.dart similarity index 87% rename from lib/components/Library/UserArtists.dart rename to lib/components/library/user_artists.dart index bbe019f37..d9e194835 100644 --- a/lib/components/Library/UserArtists.dart +++ b/lib/components/library/user_artists.dart @@ -4,11 +4,11 @@ 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/components/Artist/ArtistCard.dart'; -import 'package:spotube/components/Shared/AnonymousFallback.dart'; -import 'package:spotube/components/Shared/Waypoint.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/SpotifyDI.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'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; class UserArtists extends HookConsumerWidget { diff --git a/lib/components/Library/UserDownloads.dart b/lib/components/library/user_downloads.dart similarity index 95% rename from lib/components/Library/UserDownloads.dart rename to lib/components/library/user_downloads.dart index 33263d6d4..d0da5d332 100644 --- a/lib/components/Library/UserDownloads.dart +++ b/lib/components/library/user_downloads.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/provider/Downloader.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/provider/downloader_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class UserDownloads extends HookConsumerWidget { diff --git a/lib/components/Library/UserLocalTracks.dart b/lib/components/library/user_local_tracks.dart similarity index 93% rename from lib/components/Library/UserLocalTracks.dart rename to lib/components/library/user_local_tracks.dart index 6aaf7d3be..31354d77b 100644 --- a/lib/components/Library/UserLocalTracks.dart +++ b/lib/components/library/user_local_tracks.dart @@ -11,14 +11,14 @@ 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/components/LoaderShimmers/ShimmerTrackTile.dart'; -import 'package:spotube/components/Shared/SortTracksDropdown.dart'; -import 'package:spotube/components/Shared/TrackTile.dart'; -import 'package:spotube/hooks/useAsyncEffect.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart'; +import 'package:spotube/components/shared/sort_tracks_dropdown.dart'; +import 'package:spotube/components/shared/track_table/track_tile.dart'; +import 'package:spotube/hooks/use_async_effect.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:spotube/utils/service_utils.dart'; diff --git a/lib/components/Library/UserPlaylists.dart b/lib/components/library/user_playlists.dart similarity index 83% rename from lib/components/Library/UserPlaylists.dart rename to lib/components/library/user_playlists.dart index 8fdfcefa0..3de47a0b0 100644 --- a/lib/components/Library/UserPlaylists.dart +++ b/lib/components/library/user_playlists.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart' hide Image; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/components/Playlist/PlaylistCard.dart'; -import 'package:spotube/components/Playlist/PlaylistCreateDialog.dart'; -import 'package:spotube/components/Shared/AnonymousFallback.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/components/shared/fallbacks/anonymous_fallback.dart'; +import 'package:spotube/components/playlist/playlist_card.dart'; +import 'package:spotube/components/playlist/playlist_create_dialog.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; class UserPlaylists extends HookConsumerWidget { diff --git a/lib/components/Lyrics/LyricDelayAdjustDialog.dart b/lib/components/lyrics/lyric_delay_adjust_dialog.dart similarity index 95% rename from lib/components/Lyrics/LyricDelayAdjustDialog.dart rename to lib/components/lyrics/lyric_delay_adjust_dialog.dart index 19dacec75..735833c43 100644 --- a/lib/components/Lyrics/LyricDelayAdjustDialog.dart +++ b/lib/components/lyrics/lyric_delay_adjust_dialog.dart @@ -2,8 +2,8 @@ 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/components/Home/Sidebar.dart'; -import 'package:spotube/components/Lyrics/SyncedLyrics.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/pages/lyrics/synced_lyrics.dart'; class LyricDelayAdjustDialog extends HookConsumerWidget { const LyricDelayAdjustDialog({Key? key}) : super(key: key); diff --git a/lib/components/Player/PlayerActions.dart b/lib/components/player/player_actions.dart similarity index 91% rename from lib/components/Player/PlayerActions.dart rename to lib/components/player/player_actions.dart index a851522e3..b6d5759c3 100644 --- a/lib/components/Player/PlayerActions.dart +++ b/lib/components/player/player_actions.dart @@ -4,13 +4,13 @@ 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/components/Library/UserLocalTracks.dart'; -import 'package:spotube/components/Player/PlayerQueue.dart'; -import 'package:spotube/components/Player/SiblingTracksSheet.dart'; -import 'package:spotube/components/Shared/HeartButton.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/provider/Playback.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'; +import 'package:spotube/components/shared/heart_button.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/downloader_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class PlayerActions extends HookConsumerWidget { diff --git a/lib/components/Player/PlayerControls.dart b/lib/components/player/player_controls.dart similarity index 97% rename from lib/components/Player/PlayerControls.dart rename to lib/components/player/player_controls.dart index 71779116a..8a3895abf 100644 --- a/lib/components/Player/PlayerControls.dart +++ b/lib/components/player/player_controls.dart @@ -3,10 +3,10 @@ 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/hooks/playback.dart'; -import 'package:spotube/models/Intents.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/hooks/playback_hooks.dart'; +import 'package:spotube/collections/intents.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/primitive_utils.dart'; class PlayerControls extends HookConsumerWidget { diff --git a/lib/components/Player/PlayerOverlay.dart b/lib/components/player/player_overlay.dart similarity index 93% rename from lib/components/Player/PlayerOverlay.dart rename to lib/components/player/player_overlay.dart index a7726f688..c93b6448a 100644 --- a/lib/components/Player/PlayerOverlay.dart +++ b/lib/components/player/player_overlay.dart @@ -4,11 +4,11 @@ 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/components/Player/PlayerTrackDetails.dart'; -import 'package:spotube/hooks/playback.dart'; -import 'package:spotube/hooks/usePaletteColor.dart'; -import 'package:spotube/models/Intents.dart'; -import 'package:spotube/provider/Playback.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'; +import 'package:spotube/collections/intents.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/service_utils.dart'; class PlayerOverlay extends HookConsumerWidget { diff --git a/lib/components/Player/PlayerQueue.dart b/lib/components/player/player_queue.dart similarity index 93% rename from lib/components/Player/PlayerQueue.dart rename to lib/components/player/player_queue.dart index d7a04849d..a160a7da9 100644 --- a/lib/components/Player/PlayerQueue.dart +++ b/lib/components/player/player_queue.dart @@ -5,10 +5,10 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:scroll_to_index/scroll_to_index.dart'; -import 'package:spotube/components/Shared/NotFound.dart'; -import 'package:spotube/components/Shared/TrackTile.dart'; -import 'package:spotube/hooks/useAutoScrollController.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/fallbacks/not_found.dart'; +import 'package:spotube/components/shared/track_table/track_tile.dart'; +import 'package:spotube/hooks/use_auto_scroll_controller.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/primitive_utils.dart'; class PlayerQueue extends HookConsumerWidget { diff --git a/lib/components/Player/PlayerTrackDetails.dart b/lib/components/player/player_track_details.dart similarity index 91% rename from lib/components/Player/PlayerTrackDetails.dart rename to lib/components/player/player_track_details.dart index 9dfc079b2..5209027f9 100644 --- a/lib/components/Player/PlayerTrackDetails.dart +++ b/lib/components/player/player_track_details.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class PlayerTrackDetails extends HookConsumerWidget { diff --git a/lib/components/Player/SiblingTracksSheet.dart b/lib/components/player/sibling_tracks_sheet.dart similarity index 96% rename from lib/components/Player/SiblingTracksSheet.dart rename to lib/components/player/sibling_tracks_sheet.dart index 172aedfce..312bc6dc4 100644 --- a/lib/components/Player/SiblingTracksSheet.dart +++ b/lib/components/player/sibling_tracks_sheet.dart @@ -4,8 +4,8 @@ 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/components/Shared/UniversalImage.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/primitive_utils.dart'; class SiblingTracksSheet extends HookConsumerWidget { diff --git a/lib/components/Playlist/PlaylistCard.dart b/lib/components/playlist/playlist_card.dart similarity index 88% rename from lib/components/Playlist/PlaylistCard.dart rename to lib/components/playlist/playlist_card.dart index 569348b11..a92577be1 100644 --- a/lib/components/Playlist/PlaylistCard.dart +++ b/lib/components/playlist/playlist_card.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Shared/PlaybuttonCard.dart'; -import 'package:spotube/hooks/useBreakpointValue.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/playbutton_card.dart'; +import 'package:spotube/hooks/use_breakpoint_value.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Playlist/PlaylistCreateDialog.dart b/lib/components/playlist/playlist_create_dialog.dart similarity index 97% rename from lib/components/Playlist/PlaylistCreateDialog.dart rename to lib/components/playlist/playlist_create_dialog.dart index 71fc1b3b5..db3917510 100644 --- a/lib/components/Playlist/PlaylistCreateDialog.dart +++ b/lib/components/playlist/playlist_create_dialog.dart @@ -3,8 +3,8 @@ 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/components/Home/Sidebar.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; class PlaylistCreateDialog extends HookConsumerWidget { diff --git a/lib/components/Playlist/PlaylistGenreView.dart b/lib/components/playlist/playlist_genre_view.dart similarity index 92% rename from lib/components/Playlist/PlaylistGenreView.dart rename to lib/components/playlist/playlist_genre_view.dart index 892bca9bd..a0aeb0d0a 100644 --- a/lib/components/Playlist/PlaylistGenreView.dart +++ b/lib/components/playlist/playlist_genre_view.dart @@ -2,9 +2,9 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Playlist/PlaylistCard.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/playlist/playlist_card.dart'; +import 'package:spotube/provider/spotify_provider.dart'; class PlaylistGenreView extends ConsumerWidget { final String genreId; diff --git a/lib/components/Player/Player.dart b/lib/components/root/bottom_player.dart similarity index 91% rename from lib/components/Player/Player.dart rename to lib/components/root/bottom_player.dart index 616f787f3..a739b8b5d 100644 --- a/lib/components/Player/Player.dart +++ b/lib/components/root/bottom_player.dart @@ -5,16 +5,16 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:macos_ui/macos_ui.dart'; import 'package:fluent_ui/fluent_ui.dart' as FluentUI; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Player/PlayerActions.dart'; -import 'package:spotube/components/Player/PlayerOverlay.dart'; -import 'package:spotube/components/Player/PlayerTrackDetails.dart'; -import 'package:spotube/components/Player/PlayerControls.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/hooks/usePlatformProperty.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/player/player_actions.dart'; +import 'package:spotube/components/player/player_overlay.dart'; +import 'package:spotube/components/player/player_track_details.dart'; +import 'package:spotube/components/player/player_controls.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/hooks/use_platform_property.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:flutter/material.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class Player extends HookConsumerWidget { diff --git a/lib/components/Home/Sidebar.dart b/lib/components/root/sidebar.dart similarity index 95% rename from lib/components/Home/Sidebar.dart rename to lib/components/root/sidebar.dart index c7557392d..91bbff0e2 100644 --- a/lib/components/Home/Sidebar.dart +++ b/lib/components/root/sidebar.dart @@ -6,14 +6,14 @@ import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:flutter/material.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/sideBarTiles.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/collections/side_bar_tiles.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/downloader_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:fluent_ui/fluent_ui.dart' as FluentUI; diff --git a/lib/components/Home/SpotubeNavigationBar.dart b/lib/components/root/spotube_navigation_bar.dart similarity index 86% rename from lib/components/Home/SpotubeNavigationBar.dart rename to lib/components/root/spotube_navigation_bar.dart index e7bc268a5..4ab6bd4b4 100644 --- a/lib/components/Home/SpotubeNavigationBar.dart +++ b/lib/components/root/spotube_navigation_bar.dart @@ -2,11 +2,11 @@ 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/components/Home/Sidebar.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/sideBarTiles.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/collections/side_bar_tiles.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/provider/downloader_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; class SpotubeNavigationBar extends HookConsumerWidget { final int selectedIndex; diff --git a/lib/components/Settings/ColorSchemePickerDialog.dart b/lib/components/settings/color_scheme_picker_dialog.dart similarity index 97% rename from lib/components/Settings/ColorSchemePickerDialog.dart rename to lib/components/settings/color_scheme_picker_dialog.dart index d965f0d43..d545f0cec 100644 --- a/lib/components/Settings/ColorSchemePickerDialog.dart +++ b/lib/components/settings/color_scheme_picker_dialog.dart @@ -2,8 +2,8 @@ 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/components/Home/Sidebar.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; final highContrast = MaterialColor( const Color.fromARGB(255, 104, 104, 104).value, diff --git a/lib/components/Shared/AdaptiveListTile.dart b/lib/components/shared/adaptive/adaptive_list_tile.dart similarity index 94% rename from lib/components/Shared/AdaptiveListTile.dart rename to lib/components/shared/adaptive/adaptive_list_tile.dart index 48616d472..2f69ea9ab 100644 --- a/lib/components/Shared/AdaptiveListTile.dart +++ b/lib/components/shared/adaptive/adaptive_list_tile.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Home/Sidebar.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; class AdaptiveListTile extends HookWidget { final Widget Function(BuildContext, StateSetter?)? trailing; diff --git a/lib/components/Shared/AdaptivePopupMenuButton.dart b/lib/components/shared/adaptive/adaptive_popup_menu_button.dart similarity index 98% rename from lib/components/Shared/AdaptivePopupMenuButton.dart rename to lib/components/shared/adaptive/adaptive_popup_menu_button.dart index 357522927..72a9b7876 100644 --- a/lib/components/Shared/AdaptivePopupMenuButton.dart +++ b/lib/components/shared/adaptive/adaptive_popup_menu_button.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:popover/popover.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; class Action extends StatelessWidget { final Widget text; diff --git a/lib/components/Shared/ColoredTabBar.dart b/lib/components/shared/colored_tab_bar.dart similarity index 100% rename from lib/components/Shared/ColoredTabBar.dart rename to lib/components/shared/colored_tab_bar.dart diff --git a/lib/components/Shared/DownloadConfirmationDialog.dart b/lib/components/shared/dialogs/confirm_download_dialog.dart similarity index 93% rename from lib/components/Shared/DownloadConfirmationDialog.dart rename to lib/components/shared/dialogs/confirm_download_dialog.dart index 07ef294bb..4a635de99 100644 --- a/lib/components/Shared/DownloadConfirmationDialog.dart +++ b/lib/components/shared/dialogs/confirm_download_dialog.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Home/Sidebar.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/components/root/sidebar.dart'; -class DownloadConfirmationDialog extends StatelessWidget { - const DownloadConfirmationDialog({Key? key}) : super(key: key); +class ConfirmDownloadDialog extends StatelessWidget { + const ConfirmDownloadDialog({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/components/Shared/AddTracksToPlaylistDialog.dart b/lib/components/shared/dialogs/playlist_add_track_dialog.dart similarity index 95% rename from lib/components/Shared/AddTracksToPlaylistDialog.dart rename to lib/components/shared/dialogs/playlist_add_track_dialog.dart index ba27b3662..633dea19c 100644 --- a/lib/components/Shared/AddTracksToPlaylistDialog.dart +++ b/lib/components/shared/dialogs/playlist_add_track_dialog.dart @@ -4,12 +4,12 @@ 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/provider/SpotifyDI.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; -class AddTracksToPlaylistDialog extends HookConsumerWidget { +class PlaylistAddTrackDialog extends HookConsumerWidget { final List tracks; - const AddTracksToPlaylistDialog({ + const PlaylistAddTrackDialog({ required this.tracks, Key? key, }) : super(key: key); diff --git a/lib/components/Shared/ReplaceDownloadedFileDialog.dart b/lib/components/shared/dialogs/replace_downloaded_dialog.dart similarity index 92% rename from lib/components/Shared/ReplaceDownloadedFileDialog.dart rename to lib/components/shared/dialogs/replace_downloaded_dialog.dart index 883b13652..9b8b441f0 100644 --- a/lib/components/Shared/ReplaceDownloadedFileDialog.dart +++ b/lib/components/shared/dialogs/replace_downloaded_dialog.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Home/Sidebar.dart'; +import 'package:spotube/components/root/sidebar.dart'; final replaceDownloadedFileState = StateProvider((ref) => null); -class ReplaceDownloadedFileDialog extends ConsumerWidget { +class ReplaceDownloadedDialog extends ConsumerWidget { final Track track; - const ReplaceDownloadedFileDialog({required this.track, Key? key}) + const ReplaceDownloadedDialog({required this.track, Key? key}) : super(key: key); @override diff --git a/lib/components/Shared/AnonymousFallback.dart b/lib/components/shared/fallbacks/anonymous_fallback.dart similarity index 94% rename from lib/components/Shared/AnonymousFallback.dart rename to lib/components/shared/fallbacks/anonymous_fallback.dart index 85aa9712d..979168d9b 100644 --- a/lib/components/Shared/AnonymousFallback.dart +++ b/lib/components/shared/fallbacks/anonymous_fallback.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/provider/Auth.dart'; +import 'package:spotube/provider/auth_provider.dart'; import 'package:spotube/utils/service_utils.dart'; class AnonymousFallback extends ConsumerWidget { diff --git a/lib/components/Shared/NotFound.dart b/lib/components/shared/fallbacks/not_found.dart similarity index 100% rename from lib/components/Shared/NotFound.dart rename to lib/components/shared/fallbacks/not_found.dart diff --git a/lib/components/Shared/HeartButton.dart b/lib/components/shared/heart_button.dart similarity index 97% rename from lib/components/Shared/HeartButton.dart rename to lib/components/shared/heart_button.dart index 6b87e6d95..8ec9b1373 100644 --- a/lib/components/Shared/HeartButton.dart +++ b/lib/components/shared/heart_button.dart @@ -5,9 +5,9 @@ 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/hooks/usePaletteColor.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/hooks/use_palette_color.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/components/Shared/HoverBuilder.dart b/lib/components/shared/hover_builder.dart similarity index 100% rename from lib/components/Shared/HoverBuilder.dart rename to lib/components/shared/hover_builder.dart diff --git a/lib/components/Shared/UniversalImage.dart b/lib/components/shared/image/universal_image.dart similarity index 100% rename from lib/components/Shared/UniversalImage.dart rename to lib/components/shared/image/universal_image.dart diff --git a/lib/components/Shared/AnchorButton.dart b/lib/components/shared/links/anchor_button.dart similarity index 100% rename from lib/components/Shared/AnchorButton.dart rename to lib/components/shared/links/anchor_button.dart diff --git a/lib/components/Shared/Hyperlink.dart b/lib/components/shared/links/hyper_link.dart similarity index 91% rename from lib/components/Shared/Hyperlink.dart rename to lib/components/shared/links/hyper_link.dart index 5b3055f84..88d4b2b93 100644 --- a/lib/components/Shared/Hyperlink.dart +++ b/lib/components/shared/links/hyper_link.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spotube/components/Shared/AnchorButton.dart'; +import 'package:spotube/components/shared/links/anchor_button.dart'; import 'package:url_launcher/url_launcher_string.dart'; class Hyperlink extends StatelessWidget { diff --git a/lib/components/Shared/LinkText.dart b/lib/components/shared/links/link_text.dart similarity index 91% rename from lib/components/Shared/LinkText.dart rename to lib/components/shared/links/link_text.dart index b5868deff..710cfa81a 100644 --- a/lib/components/Shared/LinkText.dart +++ b/lib/components/shared/links/link_text.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spotube/components/Shared/AnchorButton.dart'; +import 'package:spotube/components/shared/links/anchor_button.dart'; import 'package:spotube/utils/service_utils.dart'; class LinkText extends StatelessWidget { diff --git a/lib/components/Shared/PageWindowTitleBar.dart b/lib/components/shared/page_window_title_bar.dart similarity index 100% rename from lib/components/Shared/PageWindowTitleBar.dart rename to lib/components/shared/page_window_title_bar.dart diff --git a/lib/components/Shared/PlaybuttonCard.dart b/lib/components/shared/playbutton_card.dart similarity index 96% rename from lib/components/Shared/PlaybuttonCard.dart rename to lib/components/shared/playbutton_card.dart index cb4cf3e39..ea15af2aa 100644 --- a/lib/components/Shared/PlaybuttonCard.dart +++ b/lib/components/shared/playbutton_card.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Shared/HoverBuilder.dart'; -import 'package:spotube/components/Shared/SpotubeMarqueeText.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/usePlatformProperty.dart'; +import 'package:spotube/components/shared/hover_builder.dart'; +import 'package:spotube/components/shared/spotube_marquee_text.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_platform_property.dart'; class PlaybuttonCard extends HookWidget { final void Function()? onTap; diff --git a/lib/components/LoaderShimmers/ShimmerArtistProfile.dart b/lib/components/shared/shimmers/shimmer_artist_profile.dart similarity index 89% rename from lib/components/LoaderShimmers/ShimmerArtistProfile.dart rename to lib/components/shared/shimmers/shimmer_artist_profile.dart index 6cd552f03..985e0de71 100644 --- a/lib/components/LoaderShimmers/ShimmerArtistProfile.dart +++ b/lib/components/shared/shimmers/shimmer_artist_profile.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:skeleton_text/skeleton_text.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerTrackTile.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; -import 'package:spotube/hooks/useBreakpointValue.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart'; +import 'package:spotube/extensions/theme.dart'; +import 'package:spotube/hooks/use_breakpoint_value.dart'; class ShimmerArtistProfile extends HookWidget { const ShimmerArtistProfile({Key? key}) : super(key: key); diff --git a/lib/components/LoaderShimmers/ShimmerCategories.dart b/lib/components/shared/shimmers/shimmer_categories.dart similarity index 86% rename from lib/components/LoaderShimmers/ShimmerCategories.dart rename to lib/components/shared/shimmers/shimmer_categories.dart index 7d5ff4351..60b1472a8 100644 --- a/lib/components/LoaderShimmers/ShimmerCategories.dart +++ b/lib/components/shared/shimmers/shimmer_categories.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:skeleton_text/skeleton_text.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/extensions/theme.dart'; class ShimmerCategories extends StatelessWidget { const ShimmerCategories({Key? key}) : super(key: key); diff --git a/lib/components/LoaderShimmers/ShimmerLyrics.dart b/lib/components/shared/shimmers/shimmer_lyrics.dart similarity index 94% rename from lib/components/LoaderShimmers/ShimmerLyrics.dart rename to lib/components/shared/shimmers/shimmer_lyrics.dart index 27843c30c..944204874 100644 --- a/lib/components/LoaderShimmers/ShimmerLyrics.dart +++ b/lib/components/shared/shimmers/shimmer_lyrics.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:skeleton_text/skeleton_text.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/extensions/theme.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; const widths = [20, 56, 89, 60, 25, 69]; diff --git a/lib/components/LoaderShimmers/ShimmerPlaybuttonCard.dart b/lib/components/shared/shimmers/shimmer_playbutton_card.dart similarity index 98% rename from lib/components/LoaderShimmers/ShimmerPlaybuttonCard.dart rename to lib/components/shared/shimmers/shimmer_playbutton_card.dart index a6c579910..d80dca676 100644 --- a/lib/components/LoaderShimmers/ShimmerPlaybuttonCard.dart +++ b/lib/components/shared/shimmers/shimmer_playbutton_card.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; +import 'package:spotube/extensions/theme.dart'; class ShimmerPlaybuttonCardPainter extends CustomPainter { final Color background; diff --git a/lib/components/LoaderShimmers/ShimmerTrackTile.dart b/lib/components/shared/shimmers/shimmer_track_tile.dart similarity index 97% rename from lib/components/LoaderShimmers/ShimmerTrackTile.dart rename to lib/components/shared/shimmers/shimmer_track_tile.dart index 7ceddab6f..ffb091a54 100644 --- a/lib/components/LoaderShimmers/ShimmerTrackTile.dart +++ b/lib/components/shared/shimmers/shimmer_track_tile.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; +import 'package:spotube/extensions/theme.dart'; class ShimmerTrackTilePainter extends CustomPainter { final Color background; diff --git a/lib/components/Shared/SortTracksDropdown.dart b/lib/components/shared/sort_tracks_dropdown.dart similarity index 95% rename from lib/components/Shared/SortTracksDropdown.dart rename to lib/components/shared/sort_tracks_dropdown.dart index 0b42dd2a1..d66d2279d 100644 --- a/lib/components/Shared/SortTracksDropdown.dart +++ b/lib/components/shared/sort_tracks_dropdown.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Library/UserLocalTracks.dart'; +import 'package:spotube/components/library/user_local_tracks.dart'; class SortTracksDropdown extends StatelessWidget { final SortBy? value; diff --git a/lib/components/Shared/SpotubeMarqueeText.dart b/lib/components/shared/spotube_marquee_text.dart similarity index 100% rename from lib/components/Shared/SpotubeMarqueeText.dart rename to lib/components/shared/spotube_marquee_text.dart diff --git a/lib/components/Shared/SpotubePageRoute.dart b/lib/components/shared/spotube_page_route.dart similarity index 100% rename from lib/components/Shared/SpotubePageRoute.dart rename to lib/components/shared/spotube_page_route.dart diff --git a/lib/components/Shared/TrackCollectionView.dart b/lib/components/shared/track_table/track_collection_view.dart similarity index 95% rename from lib/components/Shared/TrackCollectionView.dart rename to lib/components/shared/track_table/track_collection_view.dart index d10253726..d85acc605 100644 --- a/lib/components/Shared/TrackCollectionView.dart +++ b/lib/components/shared/track_table/track_collection_view.dart @@ -3,14 +3,14 @@ import 'package:flutter_hooks/flutter_hooks.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/components/LoaderShimmers/ShimmerTrackTile.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/TracksTableView.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/components/shared/track_table/tracks_table_view.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; -import 'package:spotube/hooks/useCustomStatusBarColor.dart'; -import 'package:spotube/hooks/usePaletteColor.dart'; -import 'package:spotube/models/Logger.dart'; +import 'package:spotube/hooks/use_custom_status_bar_color.dart'; +import 'package:spotube/hooks/use_palette_color.dart'; +import 'package:spotube/models/logger.dart'; import 'package:flutter/material.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/utils/platform.dart'; diff --git a/lib/components/Shared/TrackTile.dart b/lib/components/shared/track_table/track_tile.dart similarity index 95% rename from lib/components/Shared/TrackTile.dart rename to lib/components/shared/track_table/track_tile.dart index c40d0c561..4dc8d3a24 100644 --- a/lib/components/Shared/TrackTile.dart +++ b/lib/components/shared/track_table/track_tile.dart @@ -6,16 +6,16 @@ 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' hide Image; -import 'package:spotube/components/Home/Sidebar.dart'; -import 'package:spotube/components/Shared/AdaptivePopupMenuButton.dart'; -import 'package:spotube/components/Shared/HeartButton.dart'; -import 'package:spotube/components/Shared/LinkText.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/adaptive/adaptive_popup_menu_button.dart'; +import 'package:spotube/components/shared/heart_button.dart'; +import 'package:spotube/components/shared/links/link_text.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/components/Shared/TracksTableView.dart b/lib/components/shared/track_table/tracks_table_view.dart similarity index 92% rename from lib/components/Shared/TracksTableView.dart rename to lib/components/shared/track_table/tracks_table_view.dart index a17930b05..d8782bf68 100644 --- a/lib/components/Shared/TracksTableView.dart +++ b/lib/components/shared/track_table/tracks_table_view.dart @@ -3,15 +3,15 @@ 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/components/Library/UserLocalTracks.dart'; -import 'package:spotube/components/Shared/AddTracksToPlaylistDialog.dart'; -import 'package:spotube/components/Shared/DownloadConfirmationDialog.dart'; -import 'package:spotube/components/Shared/NotFound.dart'; -import 'package:spotube/components/Shared/SortTracksDropdown.dart'; -import 'package:spotube/components/Shared/TrackTile.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/dialogs/confirm_download_dialog.dart'; +import 'package:spotube/components/shared/dialogs/playlist_add_track_dialog.dart'; +import 'package:spotube/components/shared/fallbacks/not_found.dart'; +import 'package:spotube/components/shared/sort_tracks_dropdown.dart'; +import 'package:spotube/components/shared/track_table/track_tile.dart'; +import 'package:spotube/components/library/user_local_tracks.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/provider/downloader_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:spotube/utils/service_utils.dart'; @@ -165,7 +165,7 @@ class TracksTableView extends HookConsumerWidget { final confirmed = await showPlatformAlertDialog( context, builder: (context) { - return const DownloadConfirmationDialog(); + return const ConfirmDownloadDialog(); }, ); if (confirmed != true) return; @@ -181,7 +181,7 @@ class TracksTableView extends HookConsumerWidget { await showPlatformAlertDialog( context, builder: (context) { - return AddTracksToPlaylistDialog( + return PlaylistAddTrackDialog( tracks: selectedTracks.toList(), ); }, diff --git a/lib/components/Shared/Waypoint.dart b/lib/components/shared/waypoint.dart similarity index 100% rename from lib/components/Shared/Waypoint.dart rename to lib/components/shared/waypoint.dart diff --git a/lib/extensions/album_simple.dart b/lib/extensions/album_simple.dart new file mode 100644 index 000000000..a717bf883 --- /dev/null +++ b/lib/extensions/album_simple.dart @@ -0,0 +1,18 @@ +import 'package:spotify/spotify.dart'; + +extension AlbumJson on AlbumSimple { + Map toJson() { + return { + "albumType": albumType, + "id": id, + "name": name, + "images": images + ?.map((image) => { + "height": image.height, + "url": image.url, + "width": image.width, + }) + .toList(), + }; + } +} diff --git a/lib/extensions/artist_simple.dart b/lib/extensions/artist_simple.dart new file mode 100644 index 000000000..caf2e510e --- /dev/null +++ b/lib/extensions/artist_simple.dart @@ -0,0 +1,13 @@ +import 'package:spotify/spotify.dart'; + +extension ArtistJson on ArtistSimple { + Map toJson() { + return { + "href": href, + "id": id, + "name": name, + "type": type, + "uri": uri, + }; + } +} diff --git a/lib/extensions/list-sort-multiple.dart b/lib/extensions/list.dart similarity index 100% rename from lib/extensions/list-sort-multiple.dart rename to lib/extensions/list.dart diff --git a/lib/extensions/ShimmerColorTheme.dart b/lib/extensions/theme.dart similarity index 100% rename from lib/extensions/ShimmerColorTheme.dart rename to lib/extensions/theme.dart diff --git a/lib/extensions/track.dart b/lib/extensions/track.dart new file mode 100644 index 000000000..19935e89c --- /dev/null +++ b/lib/extensions/track.dart @@ -0,0 +1,29 @@ +import 'package:spotify/spotify.dart'; +import 'package:spotube/extensions/album_simple.dart'; +import 'package:spotube/extensions/artist_simple.dart'; + +extension TrackJson on Track { + Map toJson() { + return { + "album": album?.toJson(), + "artists": artists?.map((artist) => artist.toJson()).toList(), + "availableMarkets": availableMarkets, + "discNumber": discNumber, + "duration": duration.toString(), + "durationMs": durationMs, + "explicit": explicit, + // "externalIds": externalIds, + // "externalUrls": externalUrls, + "href": href, + "id": id, + "isPlayable": isPlayable, + // "linkedFrom": linkedFrom, + "name": name, + "popularity": popularity, + "previewUrl": previewUrl, + "trackNumber": trackNumber, + "type": type, + "uri": uri, + }; + } +} diff --git a/lib/extensions/yt-video-from-cache-track.dart b/lib/extensions/video.dart similarity index 100% rename from lib/extensions/yt-video-from-cache-track.dart rename to lib/extensions/video.dart diff --git a/lib/hooks/playback.dart b/lib/hooks/playback_hooks.dart similarity index 88% rename from lib/hooks/playback.dart rename to lib/hooks/playback_hooks.dart index 23f16c855..266ac9b87 100644 --- a/lib/hooks/playback.dart +++ b/lib/hooks/playback_hooks.dart @@ -1,6 +1,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; final logger = getLogger("PlaybackHook"); diff --git a/lib/hooks/useAsyncEffect.dart b/lib/hooks/use_async_effect.dart similarity index 100% rename from lib/hooks/useAsyncEffect.dart rename to lib/hooks/use_async_effect.dart diff --git a/lib/hooks/useAutoScrollController.dart b/lib/hooks/use_auto_scroll_controller.dart similarity index 100% rename from lib/hooks/useAutoScrollController.dart rename to lib/hooks/use_auto_scroll_controller.dart diff --git a/lib/hooks/useBreakpointValue.dart b/lib/hooks/use_breakpoint_value.dart similarity index 84% rename from lib/hooks/useBreakpointValue.dart rename to lib/hooks/use_breakpoint_value.dart index 582406300..c00ba9b9a 100644 --- a/lib/hooks/useBreakpointValue.dart +++ b/lib/hooks/use_breakpoint_value.dart @@ -1,4 +1,4 @@ -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; useBreakpointValue({sm, md, lg, xl, xxl}) { final breakpoint = useBreakpoints(); diff --git a/lib/hooks/useBreakpoints.dart b/lib/hooks/use_breakpoints.dart similarity index 100% rename from lib/hooks/useBreakpoints.dart rename to lib/hooks/use_breakpoints.dart diff --git a/lib/hooks/useCustomStatusBarColor.dart b/lib/hooks/use_custom_status_bar_color.dart similarity index 100% rename from lib/hooks/useCustomStatusBarColor.dart rename to lib/hooks/use_custom_status_bar_color.dart diff --git a/lib/hooks/useForceUpdate.dart b/lib/hooks/use_force_update.dart similarity index 100% rename from lib/hooks/useForceUpdate.dart rename to lib/hooks/use_force_update.dart diff --git a/lib/hooks/useIsCurrentRoute.dart b/lib/hooks/use_is_current_route.dart similarity index 100% rename from lib/hooks/useIsCurrentRoute.dart rename to lib/hooks/use_is_current_route.dart diff --git a/lib/hooks/usePackageInfo.dart b/lib/hooks/use_package_info.dart similarity index 100% rename from lib/hooks/usePackageInfo.dart rename to lib/hooks/use_package_info.dart diff --git a/lib/hooks/usePaletteColor.dart b/lib/hooks/use_palette_color.dart similarity index 96% rename from lib/hooks/usePaletteColor.dart rename to lib/hooks/use_palette_color.dart index 80fa801a5..300eff149 100644 --- a/lib/hooks/usePaletteColor.dart +++ b/lib/hooks/use_palette_color.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:palette_generator/palette_generator.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; final _paletteColorState = StateProvider( (ref) { diff --git a/lib/hooks/usePlatformProperty.dart b/lib/hooks/use_platform_property.dart similarity index 100% rename from lib/hooks/usePlatformProperty.dart rename to lib/hooks/use_platform_property.dart diff --git a/lib/hooks/useSharedPreferences.dart b/lib/hooks/use_shared_preferences.dart similarity index 100% rename from lib/hooks/useSharedPreferences.dart rename to lib/hooks/use_shared_preferences.dart diff --git a/lib/hooks/useSyncedLyrics.dart b/lib/hooks/use_synced_lyrics.dart similarity index 91% rename from lib/hooks/useSyncedLyrics.dart rename to lib/hooks/use_synced_lyrics.dart index 26a5291a9..7b9024e25 100644 --- a/lib/hooks/useSyncedLyrics.dart +++ b/lib/hooks/use_synced_lyrics.dart @@ -1,6 +1,6 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/provider/playback_provider.dart'; int useSyncedLyrics( WidgetRef ref, diff --git a/lib/hooks/useUpdateChecker.dart b/lib/hooks/use_update_checker.dart similarity index 92% rename from lib/hooks/useUpdateChecker.dart rename to lib/hooks/use_update_checker.dart index 1c1c8c2ac..844a0399c 100644 --- a/lib/hooks/useUpdateChecker.dart +++ b/lib/hooks/use_update_checker.dart @@ -6,10 +6,10 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:http/http.dart' as http; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Home/Sidebar.dart'; -import 'package:spotube/components/Shared/AnchorButton.dart'; -import 'package:spotube/hooks/usePackageInfo.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/components/shared/links/anchor_button.dart'; +import 'package:spotube/hooks/use_package_info.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:version/version.dart'; diff --git a/lib/main.dart b/lib/main.dart index 3d54019e0..d8c8bcd41 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,20 +10,20 @@ import 'package:hive_flutter/hive_flutter.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:spotube/components/Shared/ReplaceDownloadedFileDialog.dart'; +import 'package:spotube/collections/cache_keys.dart'; +import 'package:spotube/components/shared/dialogs/replace_downloaded_dialog.dart'; import 'package:spotube/entities/CacheTrack.dart'; -import 'package:spotube/models/GoRouteDeclarations.dart'; -import 'package:spotube/models/Intents.dart'; -import 'package:spotube/models/LocalStorageKeys.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/AudioPlayer.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/UserPreferences.dart'; -import 'package:spotube/provider/YouTube.dart'; -import 'package:spotube/services/MobileAudioService.dart'; -import 'package:spotube/themes/dark-theme.dart'; -import 'package:spotube/themes/light-theme.dart'; +import 'package:spotube/collections/routes.dart'; +import 'package:spotube/collections/intents.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/audio_player_provider.dart'; +import 'package:spotube/provider/downloader_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; +import 'package:spotube/provider/youtube_provider.dart'; +import 'package:spotube/services/mobile_audio_service.dart'; +import 'package:spotube/themes/dark_theme.dart'; +import 'package:spotube/themes/light_theme.dart'; import 'package:spotube/utils/platform.dart'; final bowl = QueryBowl(refetchOnExternalDataChange: true); @@ -57,73 +57,68 @@ void main() async { builder: (context) { return ProviderScope( overrides: [ - playbackProvider.overrideWithProvider( - ChangeNotifierProvider( - (ref) { - final youtube = ref.watch(youtubeProvider); - final player = ref.watch(audioPlayerProvider); + playbackProvider.overrideWith( + (ref) { + final youtube = ref.watch(youtubeProvider); + final player = ref.watch(audioPlayerProvider); - final playback = Playback( - player: player, - youtube: youtube, - ref: ref, - ); - - if (audioServiceHandler == null) { - AudioService.init( - builder: () => MobileAudioService(playback), - config: const AudioServiceConfig( - androidNotificationChannelId: 'com.krtirtho.Spotube', - androidNotificationChannelName: 'Spotube', - androidNotificationOngoing: true, - ), - ).then( - (value) { - playback.mobileAudioService = value; - audioServiceHandler = value; - }, - ); - } + final playback = Playback( + player: player, + youtube: youtube, + ref: ref, + ); - return playback; - }, - ), - ), - downloaderProvider.overrideWithProvider( - ChangeNotifierProvider( - (ref) { - return Downloader( - ref, - queueInstance, - yt: ref.watch(youtubeProvider), - downloadPath: ref.watch( - userPreferencesProvider.select( - (s) => s.downloadLocation, - ), + if (audioServiceHandler == null) { + AudioService.init( + builder: () => MobileAudioService(playback), + config: const AudioServiceConfig( + androidNotificationChannelId: 'com.krtirtho.Spotube', + androidNotificationChannelName: 'Spotube', + androidNotificationOngoing: true, ), - onFileExists: (track) { - final logger = getLogger(Downloader); - try { - logger.v( - "[onFileExists] download confirmation for ${track.name}", - ); - return showPlatformAlertDialog( - context, - builder: (_) => - ReplaceDownloadedFileDialog(track: track), - ).then((s) => s ?? false); - } catch (e, stack) { - logger.e( - "onFileExists", - e, - stack, - ); - return false; - } + ).then( + (value) { + playback.mobileAudioService = value; + audioServiceHandler = value; }, ); - }, - ), + } + + return playback; + }, + ), + downloaderProvider.overrideWith( + (ref) { + return Downloader( + ref, + queueInstance, + yt: ref.watch(youtubeProvider), + downloadPath: ref.watch( + userPreferencesProvider.select( + (s) => s.downloadLocation, + ), + ), + onFileExists: (track) { + final logger = getLogger(Downloader); + try { + logger.v( + "[onFileExists] download confirmation for ${track.name}", + ); + return showPlatformAlertDialog( + context, + builder: (_) => ReplaceDownloadedDialog(track: track), + ).then((s) => s ?? false); + } catch (e, stack) { + logger.e( + "onFileExists", + e, + stack, + ); + return false; + } + }, + ); + }, ) ], child: QueryBowlScope( diff --git a/lib/models/CurrentPlaylist.dart b/lib/models/current_playlist.dart similarity index 56% rename from lib/models/CurrentPlaylist.dart rename to lib/models/current_playlist.dart index b763cb2ea..34d953ef2 100644 --- a/lib/models/CurrentPlaylist.dart +++ b/lib/models/current_playlist.dart @@ -1,60 +1,6 @@ import 'package:spotify/spotify.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; - -extension AlbumJson on AlbumSimple { - Map toJson() { - return { - "albumType": albumType, - "id": id, - "name": name, - "images": images - ?.map((image) => { - "height": image.height, - "url": image.url, - "width": image.width, - }) - .toList(), - }; - } -} - -extension ArtistJson on ArtistSimple { - Map toJson() { - return { - "href": href, - "id": id, - "name": name, - "type": type, - "uri": uri, - }; - } -} - -extension TrackJson on Track { - Map toJson() { - return { - "album": album?.toJson(), - "artists": artists?.map((artist) => artist.toJson()).toList(), - "availableMarkets": availableMarkets, - "discNumber": discNumber, - "duration": duration.toString(), - "durationMs": durationMs, - "explicit": explicit, - // "externalIds": externalIds, - // "externalUrls": externalUrls, - "href": href, - "id": id, - "isPlayable": isPlayable, - // "linkedFrom": linkedFrom, - "name": name, - "popularity": popularity, - "previewUrl": previewUrl, - "trackNumber": trackNumber, - "type": type, - "uri": uri, - }; - } -} +import 'package:spotube/models/spotube_track.dart'; +import 'package:spotube/extensions/track.dart'; class CurrentPlaylist { List? _tempTrack; diff --git a/lib/models/Logger.dart b/lib/models/logger.dart similarity index 100% rename from lib/models/Logger.dart rename to lib/models/logger.dart diff --git a/lib/models/LyricsModels.dart b/lib/models/lyrics.dart similarity index 100% rename from lib/models/LyricsModels.dart rename to lib/models/lyrics.dart diff --git a/lib/models/SpotifySpotubeCredentials.dart b/lib/models/spotify_spotube_credentials.dart similarity index 100% rename from lib/models/SpotifySpotubeCredentials.dart rename to lib/models/spotify_spotube_credentials.dart diff --git a/lib/models/SpotubeTrack.dart b/lib/models/spotube_track.dart similarity index 93% rename from lib/models/SpotubeTrack.dart rename to lib/models/spotube_track.dart index fcdabcad9..dd3d0fa8e 100644 --- a/lib/models/SpotubeTrack.dart +++ b/lib/models/spotube_track.dart @@ -1,6 +1,7 @@ import 'package:spotify/spotify.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/extensions/yt-video-from-cache-track.dart'; +import 'package:spotube/extensions/video.dart'; +import 'package:spotube/extensions/album_simple.dart'; +import 'package:spotube/extensions/artist_simple.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart'; enum SpotubeTrackMatchAlgorithm { diff --git a/lib/components/Album/AlbumView.dart b/lib/pages/album/album.dart similarity index 85% rename from lib/components/Album/AlbumView.dart rename to lib/pages/album/album.dart index e30aac715..09ab64022 100644 --- a/lib/components/Album/AlbumView.dart +++ b/lib/pages/album/album.dart @@ -4,20 +4,20 @@ import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Shared/HeartButton.dart'; -import 'package:spotube/components/Shared/TrackCollectionView.dart'; -import 'package:spotube/components/Shared/TracksTableView.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/components/shared/heart_button.dart'; +import 'package:spotube/components/shared/track_table/track_collection_view.dart'; +import 'package:spotube/components/shared/track_table/tracks_table_view.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; -class AlbumView extends HookConsumerWidget { +class AlbumPage extends HookConsumerWidget { final AlbumSimple album; - const AlbumView(this.album, {Key? key}) : super(key: key); + const AlbumPage(this.album, {Key? key}) : super(key: key); Future playPlaylist( Playback playback, diff --git a/lib/components/Artist/ArtistProfile.dart b/lib/pages/artist/artist.dart similarity index 94% rename from lib/components/Artist/ArtistProfile.dart rename to lib/pages/artist/artist.dart index e5924e02d..df7e13577 100644 --- a/lib/components/Artist/ArtistProfile.dart +++ b/lib/pages/artist/artist.dart @@ -6,26 +6,26 @@ 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/components/Artist/ArtistAlbumList.dart'; -import 'package:spotube/components/Artist/ArtistCard.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerArtistProfile.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/TrackTile.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useBreakpointValue.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_artist_profile.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/track_table/track_tile.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/components/artist/artist_album_list.dart'; +import 'package:spotube/components/artist/artist_card.dart'; +import 'package:spotube/hooks/use_breakpoint_value.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; -class ArtistProfile extends HookConsumerWidget { +class ArtistPage extends HookConsumerWidget { final String artistId; - final logger = getLogger(ArtistProfile); - ArtistProfile(this.artistId, {Key? key}) : super(key: key); + final logger = getLogger(ArtistPage); + ArtistPage(this.artistId, {Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/components/Login/TokenLogin.dart b/lib/pages/desktop_login/desktop_login.dart similarity index 89% rename from lib/components/Login/TokenLogin.dart rename to lib/pages/desktop_login/desktop_login.dart index 681818f53..a4de341ad 100644 --- a/lib/components/Login/TokenLogin.dart +++ b/lib/pages/desktop_login/desktop_login.dart @@ -2,12 +2,12 @@ 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/components/Login/TokenLoginForms.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/components/desktop_login/login_form.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; -class TokenLogin extends HookConsumerWidget { - const TokenLogin({Key? key}) : super(key: key); +class DesktopLoginPage extends HookConsumerWidget { + const DesktopLoginPage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/components/Login/LoginTutorial.dart b/lib/pages/desktop_login/login_tutorial.dart similarity index 93% rename from lib/components/Login/LoginTutorial.dart rename to lib/pages/desktop_login/login_tutorial.dart index 4a0ec3a3d..b320f6385 100644 --- a/lib/components/Login/LoginTutorial.dart +++ b/lib/pages/desktop_login/login_tutorial.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:introduction_screen/introduction_screen.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Login/TokenLoginForms.dart'; -import 'package:spotube/components/Shared/Hyperlink.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/provider/Auth.dart'; +import 'package:spotube/components/desktop_login/login_form.dart'; +import 'package:spotube/components/shared/links/hyper_link.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/provider/auth_provider.dart'; import 'package:spotube/utils/service_utils.dart'; class LoginTutorial extends ConsumerWidget { diff --git a/lib/components/Home/Genres.dart b/lib/pages/genre/genres.dart similarity index 80% rename from lib/components/Home/Genres.dart rename to lib/pages/genre/genres.dart index efcf61b02..857b7cc49 100644 --- a/lib/components/Home/Genres.dart +++ b/lib/pages/genre/genres.dart @@ -4,17 +4,17 @@ 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/components/Category/CategoryCard.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerCategories.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/Waypoint.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/genre/category_card.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_categories.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/waypoint.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/platform.dart'; -class Genres extends HookConsumerWidget { - const Genres({Key? key}) : super(key: key); +class GenrePage extends HookConsumerWidget { + const GenrePage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/components/Library/UserLibrary.dart b/lib/pages/library/library.dart similarity index 74% rename from lib/components/Library/UserLibrary.dart rename to lib/pages/library/library.dart index e426b00eb..7a70740f1 100644 --- a/lib/components/Library/UserLibrary.dart +++ b/lib/pages/library/library.dart @@ -2,15 +2,15 @@ import 'package:flutter/material.dart' hide Image; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Library/UserAlbums.dart'; -import 'package:spotube/components/Library/UserArtists.dart'; -import 'package:spotube/components/Library/UserDownloads.dart'; -import 'package:spotube/components/Library/UserLocalTracks.dart'; -import 'package:spotube/components/Library/UserPlaylists.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/library/user_albums.dart'; +import 'package:spotube/components/library/user_artists.dart'; +import 'package:spotube/components/library/user_downloads.dart'; +import 'package:spotube/components/library/user_local_tracks.dart'; +import 'package:spotube/components/library/user_playlists.dart'; -class UserLibrary extends HookConsumerWidget { - const UserLibrary({Key? key}) : super(key: key); +class LibraryPage extends HookConsumerWidget { + const LibraryPage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { final index = useState(0); diff --git a/lib/components/Lyrics/GeniusLyrics.dart b/lib/pages/lyrics/genius_lyrics.dart similarity index 93% rename from lib/components/Lyrics/GeniusLyrics.dart rename to lib/pages/lyrics/genius_lyrics.dart index c7e39d92a..bef6f91cf 100644 --- a/lib/components/Lyrics/GeniusLyrics.dart +++ b/lib/pages/lyrics/genius_lyrics.dart @@ -4,11 +4,11 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:palette_generator/palette_generator.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerLyrics.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_lyrics.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:tuple/tuple.dart'; diff --git a/lib/components/Lyrics/Lyrics.dart b/lib/pages/lyrics/lyrics.dart similarity index 82% rename from lib/components/Lyrics/Lyrics.dart rename to lib/pages/lyrics/lyrics.dart index 0a344a98d..07ecde2bf 100644 --- a/lib/components/Lyrics/Lyrics.dart +++ b/lib/pages/lyrics/lyrics.dart @@ -4,18 +4,18 @@ 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/components/Lyrics/GeniusLyrics.dart'; -import 'package:spotube/components/Lyrics/SyncedLyrics.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useCustomStatusBarColor.dart'; -import 'package:spotube/hooks/usePaletteColor.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_custom_status_bar_color.dart'; +import 'package:spotube/hooks/use_palette_color.dart'; +import 'package:spotube/pages/lyrics/genius_lyrics.dart'; +import 'package:spotube/pages/lyrics/synced_lyrics.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; -class Lyrics extends HookConsumerWidget { - const Lyrics({Key? key}) : super(key: key); +class LyricsPage extends HookConsumerWidget { + const LyricsPage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/components/Lyrics/SyncedLyrics.dart b/lib/pages/lyrics/synced_lyrics.dart similarity index 92% rename from lib/components/Lyrics/SyncedLyrics.dart rename to lib/pages/lyrics/synced_lyrics.dart index b87aca82e..80c6023cd 100644 --- a/lib/components/Lyrics/SyncedLyrics.dart +++ b/lib/pages/lyrics/synced_lyrics.dart @@ -5,13 +5,13 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:palette_generator/palette_generator.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerLyrics.dart'; -import 'package:spotube/components/Lyrics/LyricDelayAdjustDialog.dart'; -import 'package:spotube/components/Shared/SpotubeMarqueeText.dart'; -import 'package:spotube/hooks/useAutoScrollController.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/hooks/useSyncedLyrics.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_lyrics.dart'; +import 'package:spotube/components/shared/spotube_marquee_text.dart'; +import 'package:spotube/components/lyrics/lyric_delay_adjust_dialog.dart'; +import 'package:spotube/hooks/use_auto_scroll_controller.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/hooks/use_synced_lyrics.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:scroll_to_index/scroll_to_index.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Login/WebViewLogin.dart b/lib/pages/mobile_login/mobile_login.dart similarity index 98% rename from lib/components/Login/WebViewLogin.dart rename to lib/pages/mobile_login/mobile_login.dart index 32f29a35e..d50894f94 100644 --- a/lib/components/Login/WebViewLogin.dart +++ b/lib/pages/mobile_login/mobile_login.dart @@ -4,7 +4,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.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/provider/Auth.dart'; +import 'package:spotube/provider/auth_provider.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/service_utils.dart'; diff --git a/lib/components/Player/PlayerView.dart b/lib/pages/player/player.dart similarity index 92% rename from lib/components/Player/PlayerView.dart rename to lib/pages/player/player.dart index ffa7440c4..8468eefeb 100644 --- a/lib/components/Player/PlayerView.dart +++ b/lib/pages/player/player.dart @@ -7,16 +7,16 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:palette_generator/palette_generator.dart'; import 'package:platform_ui/platform_ui.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Player/PlayerActions.dart'; -import 'package:spotube/components/Player/PlayerControls.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/SpotubeMarqueeText.dart'; -import 'package:spotube/components/Shared/UniversalImage.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/hooks/useCustomStatusBarColor.dart'; -import 'package:spotube/hooks/usePaletteColor.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/components/player/player_actions.dart'; +import 'package:spotube/components/player/player_controls.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/spotube_marquee_text.dart'; +import 'package:spotube/components/shared/image/universal_image.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/hooks/use_custom_status_bar_color.dart'; +import 'package:spotube/hooks/use_palette_color.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class PlayerView extends HookConsumerWidget { diff --git a/lib/components/Playlist/PlaylistView.dart b/lib/pages/playlist/playlist.dart similarity index 89% rename from lib/components/Playlist/PlaylistView.dart rename to lib/pages/playlist/playlist.dart index b345660a7..812b96816 100644 --- a/lib/components/Playlist/PlaylistView.dart +++ b/lib/pages/playlist/playlist.dart @@ -2,16 +2,16 @@ import 'package:fl_query_hooks/fl_query_hooks.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:spotube/components/Shared/HeartButton.dart'; -import 'package:spotube/components/Shared/TrackCollectionView.dart'; -import 'package:spotube/components/Shared/TracksTableView.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/components/shared/heart_button.dart'; +import 'package:spotube/components/shared/track_table/track_collection_view.dart'; +import 'package:spotube/components/shared/track_table/tracks_table_view.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:flutter/material.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; diff --git a/lib/components/Home/Shell.dart b/lib/pages/root/root_app.dart similarity index 78% rename from lib/components/Home/Shell.dart rename to lib/pages/root/root_app.dart index b9e85605f..918d302ad 100644 --- a/lib/components/Home/Shell.dart +++ b/lib/pages/root/root_app.dart @@ -4,14 +4,12 @@ import 'package:flutter_hooks/flutter_hooks.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/components/Home/Sidebar.dart'; -import 'package:spotube/components/Home/SpotubeNavigationBar.dart'; -import 'package:spotube/components/Player/Player.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/ReplaceDownloadedFileDialog.dart'; -import 'package:spotube/hooks/useUpdateChecker.dart'; -import 'package:spotube/provider/Downloader.dart'; -import 'package:spotube/utils/platform.dart'; +import 'package:spotube/components/shared/dialogs/replace_downloaded_dialog.dart'; +import 'package:spotube/components/root/bottom_player.dart'; +import 'package:spotube/components/root/sidebar.dart'; +import 'package:spotube/components/root/spotube_navigation_bar.dart'; +import 'package:spotube/hooks/use_update_checker.dart'; +import 'package:spotube/provider/downloader_provider.dart'; const rootPaths = { 0: "/", @@ -20,9 +18,9 @@ const rootPaths = { 3: "/lyrics", }; -class Shell extends HookConsumerWidget { +class RootApp extends HookConsumerWidget { final Widget child; - const Shell({ + const RootApp({ required this.child, Key? key, }) : super(key: key); @@ -38,7 +36,7 @@ class Shell extends HookConsumerWidget { if (!isMounted()) return false; return await showPlatformAlertDialog( context, - builder: (context) => ReplaceDownloadedFileDialog( + builder: (context) => ReplaceDownloadedDialog( track: track, ), ) ?? diff --git a/lib/components/Search/Search.dart b/lib/pages/search/search.dart similarity index 95% rename from lib/components/Search/Search.dart rename to lib/pages/search/search.dart index cd82ccc4b..35b80da01 100644 --- a/lib/components/Search/Search.dart +++ b/lib/pages/search/search.dart @@ -5,19 +5,19 @@ 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/components/Album/AlbumCard.dart'; -import 'package:spotube/components/Artist/ArtistCard.dart'; -import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart'; -import 'package:spotube/components/Playlist/PlaylistCard.dart'; -import 'package:spotube/components/Shared/AnonymousFallback.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/components/Shared/TrackTile.dart'; -import 'package:spotube/components/Shared/Waypoint.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/SpotifyDI.dart'; +import 'package:spotube/components/album/album_card.dart'; +import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart'; +import 'package:spotube/components/shared/fallbacks/anonymous_fallback.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/components/shared/track_table/track_tile.dart'; +import 'package:spotube/components/shared/waypoint.dart'; +import 'package:spotube/components/artist/artist_card.dart'; +import 'package:spotube/components/playlist/playlist_card.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/spotify_provider.dart'; import 'package:spotube/provider/SpotifyRequests.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/primitive_utils.dart'; @@ -27,8 +27,8 @@ import 'package:collection/collection.dart'; final searchTermStateProvider = StateProvider((ref) => ""); -class Search extends HookConsumerWidget { - const Search({Key? key}) : super(key: key); +class SearchPage extends HookConsumerWidget { + const SearchPage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/components/Settings/About.dart b/lib/pages/settings/about.dart similarity index 97% rename from lib/components/Settings/About.dart rename to lib/pages/settings/about.dart index 789c413a4..3935f3082 100644 --- a/lib/components/Settings/About.dart +++ b/lib/pages/settings/about.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:platform_ui/platform_ui.dart'; -import 'package:spotube/components/Shared/Hyperlink.dart'; -import 'package:spotube/hooks/usePackageInfo.dart'; +import 'package:spotube/components/shared/links/hyper_link.dart'; +import 'package:spotube/hooks/use_package_info.dart'; const licenseText = """ BSD-4-Clause License diff --git a/lib/components/Settings/Settings.dart b/lib/pages/settings/settings.dart similarity index 97% rename from lib/components/Settings/Settings.dart rename to lib/pages/settings/settings.dart index 235395932..d99e04d73 100644 --- a/lib/components/Settings/Settings.dart +++ b/lib/pages/settings/settings.dart @@ -5,22 +5,22 @@ import 'package:flutter_hooks/flutter_hooks.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/components/Settings/About.dart'; -import 'package:spotube/components/Settings/ColorSchemePickerDialog.dart'; -import 'package:spotube/components/Shared/AdaptiveListTile.dart'; -import 'package:spotube/components/Shared/PageWindowTitleBar.dart'; -import 'package:spotube/hooks/useBreakpoints.dart'; +import 'package:spotube/components/settings/color_scheme_picker_dialog.dart'; +import 'package:spotube/components/shared/adaptive/adaptive_list_tile.dart'; +import 'package:spotube/components/shared/page_window_title_bar.dart'; +import 'package:spotube/hooks/use_breakpoints.dart'; import 'package:spotube/main.dart'; -import 'package:spotube/models/SpotifyMarkets.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; -import 'package:spotube/provider/Auth.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/UserPreferences.dart'; +import 'package:spotube/collections/spotify_markets.dart'; +import 'package:spotube/models/spotube_track.dart'; +import 'package:spotube/pages/settings/about.dart'; +import 'package:spotube/provider/auth_provider.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; import 'package:spotube/utils/platform.dart'; import 'package:url_launcher/url_launcher_string.dart'; -class Settings extends HookConsumerWidget { - const Settings({Key? key}) : super(key: key); +class SettingsPage extends HookConsumerWidget { + const SettingsPage({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { diff --git a/lib/provider/SpotifyRequests.dart b/lib/provider/SpotifyRequests.dart index 3cbc32872..6162980ae 100644 --- a/lib/provider/SpotifyRequests.dart +++ b/lib/provider/SpotifyRequests.dart @@ -1,6 +1,6 @@ import 'package:fl_query/fl_query.dart'; -import 'package:spotube/models/LyricsModels.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; +import 'package:spotube/models/lyrics.dart'; +import 'package:spotube/models/spotube_track.dart'; import 'package:spotify/spotify.dart'; import 'package:collection/collection.dart'; import 'package:spotube/utils/service_utils.dart'; diff --git a/lib/provider/AudioPlayer.dart b/lib/provider/audio_player_provider.dart similarity index 100% rename from lib/provider/AudioPlayer.dart rename to lib/provider/audio_player_provider.dart diff --git a/lib/provider/Auth.dart b/lib/provider/auth_provider.dart similarity index 98% rename from lib/provider/Auth.dart rename to lib/provider/auth_provider.dart index b4e2d8c22..47b73d5a9 100644 --- a/lib/provider/Auth.dart +++ b/lib/provider/auth_provider.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:spotube/utils/PersistedChangeNotifier.dart'; +import 'package:spotube/utils/persisted_change_notifier.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/service_utils.dart'; diff --git a/lib/provider/DBus.dart b/lib/provider/dbus_provider.dart similarity index 100% rename from lib/provider/DBus.dart rename to lib/provider/dbus_provider.dart diff --git a/lib/provider/Downloader.dart b/lib/provider/downloader_provider.dart similarity index 93% rename from lib/provider/Downloader.dart rename to lib/provider/downloader_provider.dart index 813075aa0..26ceda0fe 100644 --- a/lib/provider/Downloader.dart +++ b/lib/provider/downloader_provider.dart @@ -8,12 +8,13 @@ import 'package:metadata_god/metadata_god.dart'; import 'package:queue/queue.dart'; import 'package:path/path.dart' as path; import 'package:spotify/spotify.dart' hide Image; -import 'package:spotube/components/Shared/ReplaceDownloadedFileDialog.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/provider/UserPreferences.dart'; -import 'package:spotube/provider/YouTube.dart'; +import 'package:spotube/components/shared/dialogs/replace_downloaded_dialog.dart'; + +import 'package:spotube/models/logger.dart'; +import 'package:spotube/models/spotube_track.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; +import 'package:spotube/provider/youtube_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart' hide Comment; diff --git a/lib/provider/Playback.dart b/lib/provider/playback_provider.dart similarity index 97% rename from lib/provider/Playback.dart rename to lib/provider/playback_provider.dart index ffe755c01..40530ab41 100644 --- a/lib/provider/Playback.dart +++ b/lib/provider/playback_provider.dart @@ -8,16 +8,16 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:hive/hive.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/entities/CacheTrack.dart'; -import 'package:spotube/extensions/yt-video-from-cache-track.dart'; -import 'package:spotube/models/CurrentPlaylist.dart'; -import 'package:spotube/models/Logger.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; -import 'package:spotube/provider/AudioPlayer.dart'; -import 'package:spotube/provider/UserPreferences.dart'; -import 'package:spotube/provider/YouTube.dart'; -import 'package:spotube/services/LinuxAudioService.dart'; -import 'package:spotube/services/MobileAudioService.dart'; -import 'package:spotube/utils/PersistedChangeNotifier.dart'; +import 'package:spotube/extensions/video.dart'; +import 'package:spotube/models/current_playlist.dart'; +import 'package:spotube/models/logger.dart'; +import 'package:spotube/models/spotube_track.dart'; +import 'package:spotube/provider/audio_player_provider.dart'; +import 'package:spotube/provider/user_preferences_provider.dart'; +import 'package:spotube/provider/youtube_provider.dart'; +import 'package:spotube/services/linux_audio_service.dart'; +import 'package:spotube/services/mobile_audio_service.dart'; +import 'package:spotube/utils/persisted_change_notifier.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:spotube/utils/service_utils.dart'; @@ -25,7 +25,7 @@ import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:tuple/tuple.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart' hide Playlist; import 'package:collection/collection.dart'; -import 'package:spotube/extensions/list-sort-multiple.dart'; +import 'package:spotube/extensions/list.dart'; import 'package:http/http.dart' as http; enum PlaybackStatus { diff --git a/lib/provider/SpotifyDI.dart b/lib/provider/spotify_provider.dart similarity index 91% rename from lib/provider/SpotifyDI.dart rename to lib/provider/spotify_provider.dart index 16a4b03f8..f25893de7 100644 --- a/lib/provider/SpotifyDI.dart +++ b/lib/provider/spotify_provider.dart @@ -1,7 +1,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/models/generated_secrets.dart'; -import 'package:spotube/provider/Auth.dart'; +import 'package:spotube/provider/auth_provider.dart'; import 'package:spotube/utils/primitive_utils.dart'; final spotifyProvider = Provider((ref) { diff --git a/lib/provider/UserPreferences.dart b/lib/provider/user_preferences_provider.dart similarity index 96% rename from lib/provider/UserPreferences.dart rename to lib/provider/user_preferences_provider.dart index f19e2677b..378f1fb1a 100644 --- a/lib/provider/UserPreferences.dart +++ b/lib/provider/user_preferences_provider.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:spotube/components/Settings/ColorSchemePickerDialog.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; +import 'package:spotube/components/settings/color_scheme_picker_dialog.dart'; +import 'package:spotube/models/spotube_track.dart'; import 'package:spotube/models/generated_secrets.dart'; -import 'package:spotube/provider/Playback.dart'; -import 'package:spotube/utils/PersistedChangeNotifier.dart'; +import 'package:spotube/provider/playback_provider.dart'; +import 'package:spotube/utils/persisted_change_notifier.dart'; import 'package:collection/collection.dart'; import 'package:spotube/utils/platform.dart'; import 'package:spotube/utils/primitive_utils.dart'; diff --git a/lib/provider/YouTube.dart b/lib/provider/youtube_provider.dart similarity index 100% rename from lib/provider/YouTube.dart rename to lib/provider/youtube_provider.dart diff --git a/lib/services/LinuxAudioService.dart b/lib/services/linux_audio_service.dart similarity index 99% rename from lib/services/LinuxAudioService.dart rename to lib/services/linux_audio_service.dart index 05adf0b92..96f337d04 100644 --- a/lib/services/LinuxAudioService.dart +++ b/lib/services/linux_audio_service.dart @@ -3,9 +3,9 @@ import 'dart:io'; import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:dbus/dbus.dart'; -import 'package:spotube/provider/DBus.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/provider/dbus_provider.dart'; +import 'package:spotube/models/spotube_track.dart'; +import 'package:spotube/provider/playback_provider.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; class _MprisMediaPlayer2 extends DBusObject { diff --git a/lib/services/MobileAudioService.dart b/lib/services/mobile_audio_service.dart similarity index 97% rename from lib/services/MobileAudioService.dart rename to lib/services/mobile_audio_service.dart index 9f999f537..9eb4493cd 100644 --- a/lib/services/MobileAudioService.dart +++ b/lib/services/mobile_audio_service.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:audio_service/audio_service.dart'; import 'package:audio_session/audio_session.dart'; import 'package:audioplayers/audioplayers.dart'; -import 'package:spotube/provider/Playback.dart'; +import 'package:spotube/provider/playback_provider.dart'; class MobileAudioService extends BaseAudioHandler { final Playback playback; diff --git a/lib/themes/dark-theme.dart b/lib/themes/dark_theme.dart similarity index 98% rename from lib/themes/dark-theme.dart rename to lib/themes/dark_theme.dart index 42acc42e1..df1804799 100644 --- a/lib/themes/dark-theme.dart +++ b/lib/themes/dark_theme.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; +import 'package:spotube/extensions/theme.dart'; ThemeData darkTheme({ required MaterialColor accentMaterialColor, diff --git a/lib/themes/light-theme.dart b/lib/themes/light_theme.dart similarity index 98% rename from lib/themes/light-theme.dart rename to lib/themes/light_theme.dart index ac15f954d..9c84b12d0 100644 --- a/lib/themes/light-theme.dart +++ b/lib/themes/light_theme.dart @@ -2,7 +2,7 @@ import 'package:adwaita/adwaita.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:macos_ui/macos_ui.dart'; -import 'package:spotube/extensions/ShimmerColorTheme.dart'; +import 'package:spotube/extensions/theme.dart'; import 'package:fluent_ui/fluent_ui.dart' as FluentUI; final materialWhite = MaterialColor(Colors.white.value, { diff --git a/lib/utils/PersistedChangeNotifier.dart b/lib/utils/persisted_change_notifier.dart similarity index 100% rename from lib/utils/PersistedChangeNotifier.dart rename to lib/utils/persisted_change_notifier.dart diff --git a/lib/utils/service_utils.dart b/lib/utils/service_utils.dart index ac51ac5db..f4b7dd768 100644 --- a/lib/utils/service_utils.dart +++ b/lib/utils/service_utils.dart @@ -4,12 +4,12 @@ import 'package:flutter/widgets.dart' hide Element; import 'package:go_router/go_router.dart'; import 'package:html/dom.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/components/Library/UserLocalTracks.dart'; -import 'package:spotube/models/Logger.dart'; +import 'package:spotube/components/library/user_local_tracks.dart'; +import 'package:spotube/models/logger.dart'; import 'package:http/http.dart' as http; -import 'package:spotube/models/LyricsModels.dart'; -import 'package:spotube/models/SpotifySpotubeCredentials.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; +import 'package:spotube/models/lyrics.dart'; +import 'package:spotube/models/spotify_spotube_credentials.dart'; +import 'package:spotube/models/spotube_track.dart'; import 'package:spotube/models/generated_secrets.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:collection/collection.dart'; diff --git a/lib/utils/type_conversion_utils.dart b/lib/utils/type_conversion_utils.dart index dae62ebdd..6187a064b 100644 --- a/lib/utils/type_conversion_utils.dart +++ b/lib/utils/type_conversion_utils.dart @@ -5,9 +5,9 @@ import 'dart:io'; import 'package:flutter/widgets.dart' hide Image; import 'package:metadata_god/metadata_god.dart' hide Image; import 'package:path/path.dart'; -import 'package:spotube/components/Shared/AnchorButton.dart'; +import 'package:spotube/components/shared/links/anchor_button.dart'; import 'package:spotify/spotify.dart'; -import 'package:spotube/models/SpotubeTrack.dart'; +import 'package:spotube/models/spotube_track.dart'; import 'package:spotube/utils/primitive_utils.dart'; import 'package:spotube/utils/service_utils.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart';