-
-
Notifications
You must be signed in to change notification settings - Fork 82
Refactor movie app to new Stac structure #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1ec2fcf
refactor: Update movie app structure and dependencies
divyanshub024 5642424
Merge branch 'dev' into dv/update-movie-app
divyanshub024 149ed22
refactor: Update movie app theme management and remove unused files
divyanshub024 a07a82f
refactor: Improve JSON serialization and update styling in movie app …
divyanshub024 a0ea170
chore: Remove unnecessary blank line in default_stac_options.dart
divyanshub024 c042538
refactor: Update image dimensions to use double.maxFinite in movie ap…
divyanshub024 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
408 changes: 0 additions & 408 deletions
408
examples/movie_app/assets/jsons/screens/detail_screen.json
This file was deleted.
Oops, something went wrong.
453 changes: 0 additions & 453 deletions
453
examples/movie_app/assets/jsons/screens/home_screen.json
This file was deleted.
Oops, something went wrong.
102 changes: 0 additions & 102 deletions
102
examples/movie_app/assets/jsons/screens/onboarding_screen.json
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /// Application API endpoints and configuration | ||
| /// | ||
| /// This file contains all API-related constants including base URLs, | ||
| /// endpoints, and API configuration. | ||
| class AppApi { | ||
| AppApi._(); // Private constructor to prevent instantiation | ||
|
|
||
| // ============================================================================ | ||
| // Base Configuration | ||
| // ============================================================================ | ||
|
|
||
| static const String baseUrl = 'https://api.themoviedb.org/3'; | ||
| static const String imageBaseUrl = | ||
| 'https://media.themoviedb.org/t/p/w440_and_h660_face'; | ||
| static const String language = 'en-US'; | ||
|
|
||
| // ============================================================================ | ||
| // Movie Endpoints | ||
| // ============================================================================ | ||
|
|
||
| /// Trending movies endpoint for the current day | ||
| static String getTrendingMoviesUrl([int page = 1]) => | ||
| '$baseUrl/trending/movie/day?language=$language&page=$page'; | ||
|
|
||
| /// Now playing movies endpoint | ||
| static String getNowPlayingMoviesUrl([int page = 1]) => | ||
| '$baseUrl/movie/now_playing?language=$language&page=$page'; | ||
|
|
||
| /// Popular movies endpoint | ||
| static String getPopularMoviesUrl([int page = 1]) => | ||
| '$baseUrl/movie/popular?language=$language&page=$page'; | ||
|
|
||
| /// Top rated movies endpoint | ||
| static String getTopRatedMoviesUrl([int page = 1]) => | ||
| '$baseUrl/movie/top_rated?language=$language&page=$page'; | ||
|
|
||
| /// Upcoming movies endpoint | ||
| static String getUpcomingMoviesUrl([int page = 1]) => | ||
| '$baseUrl/movie/upcoming?language=$language&page=$page'; | ||
|
|
||
| /// Movie details endpoint | ||
| static String getMovieDetailsUrl(int movieId) => | ||
| '$baseUrl/movie/$movieId?language=$language'; | ||
|
|
||
| /// Movie credits endpoint | ||
| static String getMovieCreditsUrl(int movieId) => | ||
| '$baseUrl/movie/$movieId/credits?language=$language'; | ||
|
|
||
| /// Similar movies endpoint | ||
| static String getSimilarMoviesUrl(int movieId, [int page = 1]) => | ||
| '$baseUrl/movie/$movieId/similar?language=$language&page=$page'; | ||
|
|
||
| // ============================================================================ | ||
| // Image URLs | ||
| // ============================================================================ | ||
|
|
||
| /// Get full poster image URL from poster path | ||
| static String getPosterImageUrl(String posterPath) => | ||
| '$imageBaseUrl/$posterPath'; | ||
|
|
||
| /// Get full profile image URL from profile path | ||
| static String getProfileImageUrl(String profilePath) => | ||
| '$imageBaseUrl/$profilePath'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /// Application asset paths | ||
| /// | ||
| /// This file contains all asset paths used throughout the application. | ||
| class AppAssets { | ||
| AppAssets._(); // Private constructor to prevent instantiation | ||
|
|
||
| // ============================================================================ | ||
| // Images | ||
| // ============================================================================ | ||
|
|
||
| static const String onboardingImage = 'assets/images/image.png'; | ||
|
|
||
| // ============================================================================ | ||
| // JSON Screens | ||
| // ============================================================================ | ||
|
|
||
| static const String onboardingScreenJson = | ||
| 'assets/jsons/screens/onboarding_screen.json'; | ||
| static const String homeScreenJson = 'assets/jsons/screens/home_screen.json'; | ||
| static const String detailScreenJson = | ||
| 'assets/jsons/screens/detail_screen.json'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| library; | ||
|
|
||
| /// Applicationwide constants | ||
| /// | ||
| /// This file exports all constants used throughout the application | ||
| /// for convenient access via a single import. | ||
| export 'app_api.dart'; | ||
| export 'app_assets.dart'; | ||
| export 'app_strings.dart'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /// Application-wide string constants | ||
| /// | ||
| /// This file contains all user-facing strings and text content used throughout | ||
| /// the application. Grouped by feature/screen for easy maintenance. | ||
| class AppStrings { | ||
| AppStrings._(); // Private constructor to prevent instantiation | ||
|
|
||
| // ============================================================================ | ||
| // Onboarding Screen | ||
| // ============================================================================ | ||
|
|
||
| static const String onboardingTitle = 'Movie '; | ||
| static const String onboardingTitleAccent = '\nDatabase'; | ||
| static const String onboardingDescription = | ||
| 'Watch & enjoy a variety of award winning TV shows, movies, anime, and a lot more'; | ||
| static const String onboardingGetStartedButton = 'Get Started'; | ||
|
|
||
| // ============================================================================ | ||
| // Home Screen | ||
| // ============================================================================ | ||
|
|
||
| static const String nowPlaying = 'Now Playing'; | ||
| static const String popularMovies = 'Popular Movies'; | ||
| static const String trendingMovies = 'Trending Movies'; | ||
| static const String topRated = 'Top Rated'; | ||
| static const String upcomingMovies = 'Upcoming Movies'; | ||
|
|
||
| // Bottom Navigation | ||
| static const String bottomNavHome = 'Home'; | ||
| static const String bottomNavSearch = 'Search'; | ||
| static const String bottomNavProfile = 'Profile'; | ||
|
|
||
| // ============================================================================ | ||
| // Detail Screen | ||
| // ============================================================================ | ||
|
|
||
| static const String watchTrailer = 'Watch Trailer'; | ||
| static const String addToWatchlist = 'Add to Watchlist'; | ||
| static const String about = 'About'; | ||
| static const String cast = 'Cast'; | ||
| static const String similarMovies = 'Similar Movies'; | ||
|
|
||
| // ============================================================================ | ||
| // Common | ||
| // ============================================================================ | ||
|
|
||
| static const String search = 'Search'; | ||
| static const String profile = 'Profile'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // This file is automatically generated by stac init. | ||
|
|
||
| import 'package:stac_core/core/stac_options.dart'; | ||
|
|
||
| /// Default [StacOptions] for use with your stac project. | ||
| /// | ||
| /// Use this to initialize stac **before** calling [runApp]. | ||
| /// | ||
| /// Example: | ||
| /// ```dart | ||
| /// import 'package:flutter/material.dart'; | ||
| /// import 'package:stac/stac.dart'; | ||
| /// import 'default_stac_options.dart'; | ||
| /// | ||
| /// void main() { | ||
| /// Stac.initialize(options: defaultStacOptions); | ||
| /// | ||
| /// runApp(...); | ||
| /// } | ||
| /// ``` | ||
| StacOptions get defaultStacOptions => StacOptions( | ||
| name: 'movie_app', | ||
| description: '', | ||
| projectId: 'pha1PAyoVRqREK5M2k3E', | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.