Summary
- Platforms
- iOS
- Android
- APIs
- Features
- Fetch the latest videos from your favorite channel
- Retrieve all playlists from your favorite channel
- Retrieve all the videos from a playlist of your favorite channel
- Search for a video among all the videos of a that favorite channel
- Persist the user's search history
- Present the user's search history to the user
- Watch the selected Youtube video
- Either from a playlist or from the list of the latest videos of the channel.
- It is mandatory to display at least the thumbnails and titles of the video/playlist/channel
UPD. Additional features, that are implemented:
- App is fetching list of favorite channels, not only a single one
- All View Models are granular lazy singletons
- Supports fetching additional data (i.e. parts) from the Youtube Data API
- Supports multiple languages
- English
- Ukrainian
- French
- Spanish
- Supports multiple themes
- Dark
- Light
- Supports full screen videos
- Supports sorting of cached search queries by the time they were last used
google_sign_in
integration guide using your own Firebase Project. Youtube Data API should be enabled in Google Cloud Project that corresponds to your Firebase project
App requires some core packages to establish the base project structure:
get_it
- used as a dependencies container for DIinjectable
- code gen forget_it
, supports modules for 3rd party depslogger
- used for logging, injected using moduleintl
- used for localizations and proper numbers formatting
For Google API (i.e. Youtube Data API v3) the app is using the following packages:
googleapis
- autogenerated Google APIs (including Youtube Data API v3)google_sign_in
- required to authenticate the user for Google API requestsextension_google_sign_in_as_googleapis_auth
- required to create authenticated HTTP client forgoogleapis
http
- required to reference HTTP client in project according to linteriso_duration_parser
- required to parse duration fromgoogleapis
responses
These packages are used for persestence:
hive
hive_flutter
The following packages are used for various UI purposes:
lottie
- for displaying efficient animationsinfinite_scroll_pagination
- for displaying paginated responsesyoutube_player_flutter
- for displaying videosgoogle_fonts
- for nice fonts :)flutter_inset_box_shadow
- for inner shadow of the channel imagetimeago
- for formatting elapsed time since a particular datetimeshimmer
- for displaying loading elementsflutter_localized_locales
- for language namesrecase
- for changing the casing of textslocale_emoji_flutter
- for displaying the emoji of the language
These packages are really useful, but are available only during development:
mocktail
- for testing (creating mocks)hive_test
- for mockinghive
/hive_flutter
flutter_lints
- for linting the project and maintain proper code quality, that matches industry standardsbuild_runner
- for code geninjectable_generator
- for DI code genflutter_gen_runner
- for assets code gen
For Youtube Data API, the requester must be authorized and API should be enabled. To authorize the user to view Youtube Data from the application, it is needed to have:
- Firebase Project - for
google_sign_in
- including
android/app/google-services.json
- including
ios/runner/GoogleService-Info.plist
- including Android debug keystore SHA-1 in Firebase Android App (for Android debug builds to be able to sign in using Google)
- including
- Google Cloud Project (GCP, corresponding to the Firebase Project)
Here is the list of used APIs:
- YouTube Data API (v3): Channels: list
- YouTube Data API (v3): Videos: list
- YouTube Data API (v3): Playlists: list
- YouTube Data API (v3): PlaylistItems: list
- YouTube Data API (v3): Search: list
Structure
- LICENSE
- README.md
- analysis_options.yaml
- l10n.yaml
- pubspec.yaml
- pubspec.lock
- android # Android native bridge.
- ios # IOS native bridge.
- web # Web native bridge.
- test # dir for tests, TBD.
- assets # where all asset images/animations live.
- lib
- di # all related to DI.
- modules # all related to DI of 3rd party deps.
- l10n # all related to texts localizations.
- models
- db # db related models.
- resources # models that are used for resource loading...
- impl # ...and their implementations.
- youtube # youtube API related models.
- pages # UI pages.
- services # various services...
- impl # ...and their implementations.
- utils # various utils, helper classes and extensions.
- view_models # various view models...
- impl # ...and their implementations.
- widgets # place where all widget live.
- resources # widgets that are related to resources.
- slivers # all complex or reused slivers.
- tiles # all complex or reused list tile.
Consider using this commands when working with the repository:
# Obviously. Getting dependencies
flutter pub get
# Generates YoutubeStrings class with localizations
flutter gen-l10n
# Generates Assets class and injectable dependencies initialization
flutter pub run build_runner build --delete-conflicting-outputs
# Generates SHA-1 hafh from the Android debug keystore
# for Firebase to allow Google Sign In in debug buils
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore