diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index f474c4f1..3b0122b1 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "3.3.8", + "flutterSdkVersion": "3.7.3", "flavors": {} } \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 076da9bd..6e0f3215 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,82 +1,61 @@ name: 🐛 Bug -description: Report a bug or incorrect behavior -title: "[Bug] " +description: Report a bug or an incorrect behavior +title: "Write the title here" labels: - bug - - good first issue -assignees: - - KRTirtho + body: - type: checkboxes attributes: label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. + description: Make sure to check if this issue is a duplicate. options: - label: I have searched the existing issues required: true - type: textarea attributes: label: Current Behavior - description: Tell us what you're experiencing concisely. + description: Write what you are experiencing currently. validations: required: true - type: textarea attributes: label: Expected Behavior - description: Let us know what you expected to happen concisely. + description: Write what you expected to happen. validations: required: true - type: textarea attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. + label: Steps to reproduce + description: Steps to reproduce the issue. A not well written description might delay the resolve of it. placeholder: | - 1. In this environment... - 2. With this config... - 3. Run '...' - 4. See error... + 1. I opened the app + 2. I did this + 3. And that + 4. Then this happened validations: - required: false + required: true - type: input - attributes: - label: Spotube Version - description: In which version of Spotube did you encounter this bug? - placeholder: e.g. v2.3.0 - - type: dropdown attributes: label: Operating System - description: In which OS you're experiencing the bug? - multiple: true - options: - - "Android" - - "Linux" - - "Windows" - - "Mac OS" + description: The OS in which you used Spotube to face the issue. + placeholder: Android, Linux, macOS or Windows? Make sure to include the version too. validations: required: true - type: input attributes: - label: Linux Distribution (if applicable) - description: Tell us in what Linux Distribution you're experiencing the bug. - placeholder: Arch Linux - validations: - required: false - - type: input - attributes: - label: Operating System Version - description: In which version of your OS you're experiencing the bug? - placeholder: e.g. Android 10 - validations: - required: true + label: Spotube version + description: In which version of Spotube did you encounter this bug? + placeholder: (e.g.) v2.7.0 - type: dropdown attributes: - label: Installation Source - description: How did you install Spotube? + label: Installation source + description: Where did you install Spotube from? multiple: true options: - - "Official Website (spotube.netlify.app)" - - "Github Release (Binary)" - - "Github Actions (Nightly Binary)" + - "Website (spotube.netlify.app)" + - "GitHub Releases (Binary)" + - "GitHub Actions (Nightly Binary)" - "F-Droid (Android)" - "Arch User Repository (AUR)" - "Flathub (Flatpak)" @@ -85,10 +64,9 @@ body: - "Scoop (Windows)" validations: required: true - - type: textarea attributes: label: Additional information - description: Anything else you'd like to add? + description: Anything else you'd like to include? validations: required: false diff --git a/.github/ISSUE_TEMPLATE/new_feature.yml b/.github/ISSUE_TEMPLATE/new_feature.yml index 200a352a..9742f91f 100644 --- a/.github/ISSUE_TEMPLATE/new_feature.yml +++ b/.github/ISSUE_TEMPLATE/new_feature.yml @@ -1,53 +1,38 @@ name: ✨ New Feature -assignees: - - KRTirtho description: Suggest an idea -title: "[Feature] <title>" +title: "Write the title here" labels: - enhancement - - good first issue body: - type: checkboxes attributes: label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. + description: Make sure to check if this issue is a duplicate. options: - label: I have searched the existing issues required: true - - type: dropdown - attributes: - label: Category of the Feature - description: In which category you think your feature belongs to. - multiple: true - options: - - UI Improvements - - Logical Improvements - - More Efficiency - - Performance Improvements - - UX Improvements - - Code Refactor - - Unable to categorize - - type: input - attributes: - label: Credits - description: Who've contributed to this idea of this feature? - validations: - required: true - type: textarea attributes: label: Pain description: Explain the pain you're experiencing. - placeholder: e.g. I don't like that I've to do this... + placeholder: I don't like that I've to do this / I'd like to have that validations: required: true - type: textarea attributes: - label: Suggested Solution - description: Tell us about your solution + label: Suggested solution + description: Tell us about a solution you can think of + placeholder: You could add that / change this / use that validations: required: true - type: textarea attributes: - label: Useful resources/references - description: Provide us with some useful resources/references which will help us implement your solution. + label: Useful resources + description: Provide us with some useful resource which could help us implement your suggestion. + - type: textarea + attributes: + label: Additional information + description: Anything else you'd like to include? + validations: + required: false \ No newline at end of file diff --git a/README.md b/README.md index 2dd77f14..00ff51c3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ </p> -Spotube is a [Flutter](https://flutter.dev) based lightweight spotify client. It utilizes the power of Spotify & Youtube's public API & creates a hazardless, performant & resource friendly User Experience +Spotube is a [Flutter](https://flutter.dev) based lightweight Spotify client. It utilizes the power of Spotify & Youtube's public APIs to create a reliable, robust & resource-light user experience. #### <p align="center">Desktop</p> @@ -44,21 +44,21 @@ Spotube is a [Flutter](https://flutter.dev) based lightweight spotify client. It # Features -Following are the features that currently spotube offers: +Following are the features that currently Spotube offers: -- Open Source -- Anonymous/Guest Login -- Cross platform +- Open source/libre software +- Anonymous/guest login +- Cross platform support - No telemetry, diagnostics or user data collection -- Lightweight & resource friendly +- Lightweight & resource-friendly - Native performance (Thanks to Flutter+Skia) -- Playback control is on user's machine instead of server based -- Small size & less data hungry -- No spotify or youtube ads since it uses all public & free APIs (But it's recommended to support the creators by watching/liking/subscribing to the artists youtube channel or add as favourite track in spotify. Mostly buying spotify premium is the best way to support their valuable creations) -- Synced Lyrics -- Downloadable track +- Playback control is done locally instead of on the server +- Small size & less data usage +- No Spotify or YouTube ads since it uses all public & free APIs (It is still recommended to support the creators by watching/liking/subscribing to the artists' YouTube channels or liking their tracks on Spotify. Purchasing Spotify Premium is usually the best way to support their valuable creations.) +- Time synced lyrics +- Downloadable tracks -# Support this project +# Support development <a href="https://patreon.com/krtirtho"><img src="https://user-images.githubusercontent.com/61944859/180249027-678b01b8-c336-451e-b147-6d84a5b9d0e7.png" width="250"/></a> [!["Donate to out Collective"](https://opencollective.com/spotube/donate/button.png?color=blue)](https://opencollective.com/spotube) @@ -66,27 +66,27 @@ Following are the features that currently spotube offers: # Installation -I'm always releasing newer versions of binary of the software each 2-3 month with minor changes & each 6-8 month with major changes. Grab the binaries +I'm always releasing newer versions of binaries of the software every 2-3 months with minor changes & every 6-8 months with major changes. Grab them! | Platform | Package/Installation Method | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Android | [<img width='240' alt='Android Download' src='https://www.remcsteuben.com/sites/default/files/images/apkdaddy%20download.png'/>][android-dlink]<br/>[<img width='240' alt='Android Download' src='https://user-images.githubusercontent.com/61944859/174589876-bace24c0-b3fd-4c4a-bdb4-6fa82b5853ec.png'/>][fdroid-dlink] | -| Debian/Ubuntu | [<img width='240' alt='Linux Debian/Ubuntu Download' src='https://user-images.githubusercontent.com/61944859/169097994-e92aff78-fd75-4c93-b6e4-f072a4b5a7ed.png'/>][deb-dlink] <br/> Then run: `sudo apt install Spotube-linux-x86_64.deb` | -| Fedora/OpenSuse | [<img width='240' alt='Linux Fedora/OpenSuse Download' src='https://user-images.githubusercontent.com/61944859/223638350-5926b9da-04d6-4edd-931d-ad533e4ff058.png'/>][rpm-dlink] <br/> For Fedora: `sudo dnf install ./Spotube-linux-x86_64.rpm`<br/> For OpenSuse: `sudo zypper in ./Spotube-linux-x86_64.rpm` | -| Flatpak | `flatpak install com.github.KRTirtho.Spotube` <br/> <a href='https://flathub.org/apps/details/com.github.KRTirtho.Spotube'><img width='240' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/></a> | +| Android | [<img width='220' alt='Android Download' src='https://user-images.githubusercontent.com/114044633/223920025-83687de0-e463-4c5d-8122-e06e4bb7d40c.png'/>][android-dlink]<br/>[<img width='220' alt='Android Download' src='https://user-images.githubusercontent.com/61944859/174589876-bace24c0-b3fd-4c4a-bdb4-6fa82b5853ec.png'/>][fdroid-dlink] | +| Debian/Ubuntu | [<img width='220' alt='Linux Debian/Ubuntu Download' src='https://user-images.githubusercontent.com/61944859/169097994-e92aff78-fd75-4c93-b6e4-f072a4b5a7ed.png'/>][deb-dlink] <br/> Then run: `sudo apt install Spotube-linux-x86_64.deb` | +| Fedora/OpenSuse | [<img width='220' alt='Linux Fedora/OpenSuse Download' src='https://user-images.githubusercontent.com/61944859/223638350-5926b9da-04d6-4edd-931d-ad533e4ff058.png'/>][rpm-dlink] <br/> For Fedora: `sudo dnf install ./Spotube-linux-x86_64.rpm`<br/> For OpenSuse: `sudo zypper in ./Spotube-linux-x86_64.rpm` | +| Flatpak | `flatpak install com.github.KRTirtho.Spotube` <br/> <a href='https://flathub.org/apps/details/com.github.KRTirtho.Spotube'><img width='220' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/></a> | | Arch/Manjaro | pamac: `pamac install spotube-bin` <br/> yay: `yay -Sy spotube-bin` | -| AppImage | [<img width='240' alt='AppImage Download' src='https://user-images.githubusercontent.com/61944859/169455015-13385466-8901-48fe-ba90-b62d58b0be64.png'/>][appimage-dlink]<br/> **Note**: AppImages require [appimage-launcher](https://github.com/TheAssassin/AppImageLauncher) to be installed | -| Linux (tarball) | [<img width='240' alt='Tarball Download' src='https://user-images.githubusercontent.com/61944859/169456985-e0ba1fd4-10e8-4cc0-ab94-337acc6e0295.png'/>][linux-dlink] | -| Windows | [<img width='240' alt='Windows Download' src='https://get.todoist.help/hc/article_attachments/4403191721234/WindowsButton.svg'/>][win32-dlink] | -| Windows (Chocolatey) | `choco install spotube` | +| AppImage | [<img width='220' alt='AppImage Download' src='https://user-images.githubusercontent.com/61944859/169455015-13385466-8901-48fe-ba90-b62d58b0be64.png'/>][appimage-dlink]<br/> **Note**: AppImages require [appimage-launcher](https://github.com/TheAssassin/AppImageLauncher) to be installed | +| Linux (tarball) | [<img width='220' alt='Tarball Download' src='https://user-images.githubusercontent.com/61944859/169456985-e0ba1fd4-10e8-4cc0-ab94-337acc6e0295.png'/>][linux-dlink] | +| Windows | [<img width='220' alt='Windows Download' src='https://get.todoist.help/hc/article_attachments/4403191721234/WindowsButton.svg'/>][win32-dlink] | +| Windows (<a href="https://chocolatey.org">Chocolatey</a>) | `choco install spotube` | | Windows (<a href="https://scoop.sh/">Scoop</a>) | `scoop bucket add extras` <br/> `scoop install spotube` | -| Windows (WinGet) | `winget install --id KRTirtho.Spotube` | -| MacOS | [<img width='240' alt='MacOS Download' src='https://reachify.io/wp-content/uploads/2018/09/mac-download-button-1.png'/>][mac-dlink] | +| Windows (<a href="https://github.com/microsoft/winget-cli">WinGet</a>) | `winget install --id KRTirtho.Spotube` | +| MacOS | [<img width='220' alt='MacOS Download' src='https://reachify.io/wp-content/uploads/2018/09/mac-download-button-1.png'/>][mac-dlink] | > **Note!:** If you don't understand this download table. You can read [installation instructions][wiki-installation-instructions] from the wiki ## Nightly Builds -Get the latest nightly builds of Spotube [here](https://github.com/KRTirtho/spotube/releases/tag/nightly) +Get the latest nightly builds of Spotube [here](https://github.com/KRTirtho/spotube/releases/tag/nightly). # TODO: - [ ] Windows OS Media Control & Media Keys Support @@ -96,26 +96,26 @@ Get the latest nightly builds of Spotube [here](https://github.com/KRTirtho/spot # Building from source -You can find the details [here](CONTRIBUTION.md#your-first-code-contribution) +You can find the details [here](CONTRIBUTION.md#your-first-code-contribution). -# Things that don't work +# Things that do not work -- Shows & Podcasts aren't supported as it'd require premium anyway +- Shows & Podcasts are not supported, as a premium subscription would be needed for that functionality. # License [BSD-4-Clause](/LICENSE) -But why? You can learn about it [here](https://dev.to/krtirtho/choosing-open-source-license-wisely-1m3p) +But why? You can learn about it [here](https://dev.to/krtirtho/choosing-open-source-license-wisely-1m3p). -# Financial Contributors +# Financial contributors ## Backers ![Backers](https://opencollective.com/spotube/backer.svg?button=false) ![Donors](https://opencollective.com/spotube/tiers/donor.svg?button=false) ## Sponsors <p align="center"> - <img src="https://opencollective.com/spotube/tiers/sponsor.svg" alt="Sponsor Spotube" width="69%"> + <img src="https://opencollective.com/spotube/tiers/sponsor.svg" alt="Sponsor Spotube" width="69%"> <!-- nice. --> </p> # Library/Plugin/Framework Credits @@ -201,20 +201,18 @@ But why? You can learn about it [here](https://dev.to/krtirtho/choosing-open-sou 1. [spotify](https://github.com/rinukkusu/spotify-dart) - An incomplete dart library for interfacing with the Spotify Web API. 1. [window_size](https://github.com/google/flutter-desktop-embedding.git) - Allows resizing and repositioning the window containing Flutter. -# The Team +# The team - [Kingkor Roy Tirtho](https://github.com/KRTirtho) - The Founder, Maintainer and Lead Developer - [Owen Conor](https://github.com/owencz1998) - The Cool Discord Moderator - [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer - [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy -# Social handlers +# Social platforms -Follow me on [Twitter](https://twitter.com/@krtirtho) for newer updates about this application - - -<p align="center">© 2022 Spotube</p> +Follow me on [Twitter](https://twitter.com/@krtirtho), or join our amazing [Discord](https://discord.gg/uJ94vxB6vg) server to always get newer updates about the application. +<b><p align="center">© 2023 Spotube</p></b> <!-- Variables/Text References --> [win32-dlink]: https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-windows-x86_64-setup.exe diff --git a/lib/hooks/use_spotify_infinite_query.dart b/lib/hooks/use_spotify_infinite_query.dart index d56d3ca7..2063b083 100644 --- a/lib/hooks/use_spotify_infinite_query.dart +++ b/lib/hooks/use_spotify_infinite_query.dart @@ -15,8 +15,8 @@ InfiniteQuery<DataType, ErrorType, PageType> required WidgetRef ref, required InfiniteQueryNextPage<DataType, PageType> nextPage, required PageType initialPage, - RetryConfig retryConfig = DefaultConstants.retryConfig, - RefreshConfig refreshConfig = DefaultConstants.refreshConfig, + RetryConfig? retryConfig, + RefreshConfig? refreshConfig, JsonConfig<DataType>? jsonConfig, ValueChanged<PageEvent<DataType, PageType>>? onData, ValueChanged<PageEvent<ErrorType, PageType>>? onError, diff --git a/lib/hooks/use_spotify_mutation.dart b/lib/hooks/use_spotify_mutation.dart index 7dd9d84e..637f778f 100644 --- a/lib/hooks/use_spotify_mutation.dart +++ b/lib/hooks/use_spotify_mutation.dart @@ -10,7 +10,7 @@ Mutation<DataType, ErrorType, VariablesType> Future<DataType> Function(VariablesType variables, SpotifyApi spotify) mutationFn, { required WidgetRef ref, - RetryConfig retryConfig = DefaultConstants.retryConfig, + RetryConfig? retryConfig, MutationOnDataFn<DataType, RecoveryType>? onData, MutationOnErrorFn<ErrorType, RecoveryType>? onError, MutationOnMutationFn<VariablesType, RecoveryType>? onMutate, diff --git a/lib/hooks/use_spotify_query.dart b/lib/hooks/use_spotify_query.dart index 209f3391..0c79de91 100644 --- a/lib/hooks/use_spotify_query.dart +++ b/lib/hooks/use_spotify_query.dart @@ -16,8 +16,8 @@ Query<DataType, ErrorType> useSpotifyQuery<DataType, ErrorType>( final SpotifyQueryFn<DataType> queryFn, { required WidgetRef ref, final DataType? initial, - final RetryConfig retryConfig = DefaultConstants.retryConfig, - final RefreshConfig refreshConfig = DefaultConstants.refreshConfig, + final RetryConfig? retryConfig, + final RefreshConfig? refreshConfig, final JsonConfig<DataType>? jsonConfig, final ValueChanged<DataType>? onData, final ValueChanged<ErrorType>? onError, diff --git a/lib/main.dart b/lib/main.dart index 79f66ec5..31c5c100 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -171,6 +171,7 @@ void main(List<String> rawArgs) async { ) ], child: QueryClientProvider( + staleDuration: const Duration(minutes: 30), child: const Spotube(), ), ); diff --git a/lib/services/queries/category.dart b/lib/services/queries/category.dart index b23436fc..ff8ca573 100644 --- a/lib/services/queries/category.dart +++ b/lib/services/queries/category.dart @@ -1,5 +1,4 @@ import 'package:fl_query/fl_query.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/hooks/use_spotify_infinite_query.dart'; @@ -9,8 +8,6 @@ class CategoryQueries { InfiniteQuery<Page<Category>, dynamic, int> list( WidgetRef ref, String recommendationMarket) { - final context = useContext(); - return useSpotifyInfiniteQuery<Page<Category>, dynamic, int>( "category-playlists", (pageParam, spotify) async { @@ -30,10 +27,6 @@ class CategoryQueries { } return lastPageData.nextOffset; }, - refreshConfig: RefreshConfig.withDefaults( - context, - staleDuration: const Duration(minutes: 30), - ), ref: ref, ); } diff --git a/pubspec.lock b/pubspec.lock index 394427ec..e204880f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -534,18 +534,26 @@ packages: dependency: "direct main" description: name: fl_query - sha256: d9ebed8f024ef8e1eb9770d632ed738539dc576374a3498d5344d6ab27708563 + sha256: b119e0d7e4cb615780f6cab00e7b40f88f8f549d9f8d20f6e1076e08cbf97c42 url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.1" + version: "1.0.0-alpha.2" fl_query_hooks: dependency: "direct main" description: name: fl_query_hooks - sha256: "868974a332ff28ffd837edf995b8c579dac0e590215d8f4d13ce84c7b6f2e53c" + sha256: "9a4263cc5e1ef6e246089602256011172a9d3be212c41c08d67bc365ce6fec22" url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.1" + version: "1.0.0-alpha.2" + fluent_ui: + dependency: "direct main" + description: + name: fluent_ui + sha256: "29d85b74ee8d051bed9b5234afd50af4a693fef91f4e79657644051c23d789fb" + url: "https://pub.dev" + source: hosted + version: "4.4.1" fluentui_system_icons: dependency: "direct main" description: @@ -663,6 +671,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_mailer: dependency: transitive description: @@ -1257,6 +1270,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" + recase: + dependency: transitive + description: + name: recase + sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 + url: "https://pub.dev" + source: hosted + version: "4.1.0" riverpod: dependency: transitive description: @@ -1281,6 +1302,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.6" + scroll_pos: + dependency: transitive + description: + name: scroll_pos + sha256: cfca311b6b8d51538ff90e206fbe6ce3b36e7125ea6da4a40eb626c7f9f083b1 + url: "https://pub.dev" + source: hosted + version: "0.3.0" scroll_to_index: dependency: "direct main" description: @@ -1738,4 +1767,4 @@ packages: version: "1.12.3" sdks: dart: ">=2.19.0 <3.0.0" - flutter: ">=3.3.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 979057fb..14e5cbd2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,8 +26,9 @@ dependencies: curved_navigation_bar: ^1.0.3 dbus: ^0.7.8 file_picker: ^5.2.2 - fl_query: ^1.0.0-alpha.0 - fl_query_hooks: ^1.0.0-alpha.0 + fl_query: ^1.0.0-alpha.2 + fl_query_hooks: ^1.0.0-alpha.2 + fluent_ui: ^4.3.0 fluentui_system_icons: ^1.1.189 flutter: sdk: flutter