Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
408 changes: 0 additions & 408 deletions examples/movie_app/assets/jsons/screens/detail_screen.json

This file was deleted.

453 changes: 0 additions & 453 deletions examples/movie_app/assets/jsons/screens/home_screen.json

This file was deleted.

102 changes: 0 additions & 102 deletions examples/movie_app/assets/jsons/screens/onboarding_screen.json

This file was deleted.

Empty file.
64 changes: 64 additions & 0 deletions examples/movie_app/lib/constants/app_api.dart
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';
}
22 changes: 22 additions & 0 deletions examples/movie_app/lib/constants/app_assets.dart
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';
}
9 changes: 9 additions & 0 deletions examples/movie_app/lib/constants/app_constants.dart
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';
49 changes: 49 additions & 0 deletions examples/movie_app/lib/constants/app_strings.dart
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';
}
25 changes: 25 additions & 0 deletions examples/movie_app/lib/default_stac_options.dart
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',
);
85 changes: 9 additions & 76 deletions examples/movie_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:movie_app/default_stac_options.dart';
import 'package:movie_app/themes/app_theme.dart';
import 'package:movie_app/widgets/movie_carousel/movie_carousel_parser.dart';
import 'package:stac/stac.dart';

Expand All @@ -17,7 +19,11 @@ void main() async {
),
);

await Stac.initialize(dio: dio, parsers: [MovieCarouselParser()]);
await Stac.initialize(
options: defaultStacOptions,
dio: dio,
parsers: [MovieCarouselParser()],
);

runApp(const MyApp());
}
Expand All @@ -29,83 +35,10 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return StacApp(
title: 'Flutter Demo',
theme: StacTheme.fromJson(darkThemeJson),
theme: darkTheme,
homeBuilder: (_) {
return Stac.fromAssets('assets/jsons/screens/onboarding_screen.json');
return Stac(routeName: 'onboarding_screen');
},
);
}
}

final Map<String, dynamic> lightThemeJson = {
"brightness": "light",
"colorScheme": {
"brightness": "light",
"primary": "#14865F",
"onPrimary": "#FFFFFF",
"secondary": "#14865F",
"onSecondary": "#FFFFFF",
"background": "#FFFFFF",
"onBackground": "#010810",
"surface": "#FFFFFF",
"onSurface": "#010810",
"surfaceVariant": "#F6F7F8",
"onSurfaceVariant": "#65010810",
"error": "#FD1717",
"onError": "#FFFFFF",
"outline": "#080110810",
"onOutline": "#120110810",
},
};

final Map<String, dynamic> darkThemeJson = {
"brightness": "dark",
"colorScheme": {
"brightness": "dark",
"primary": "#95E183",
"onPrimary": "#050608",
"secondary": "#95E183",
"onSecondary": "#FFFFFF",
"background": "#050608",
"onBackground": "#FFFFFF",
"surface": "#050608",
"onSurface": "#FFFFFF",
"surfaceVariant": "#101214",
"onSurfaceVariant": "#65FFFFFF",
"error": "#FF6565",
"onError": "#050608",
"outline": "#08FFFFFF",
"onOutline": "#12FFFFFF",
},
"textTheme": {
"displayLarge": {"fontSize": 48, "fontWeight": "w700", "height": 1.1},
"displayMedium": {"fontSize": 40, "fontWeight": "w700", "height": 1.1},
"displaySmall": {"fontSize": 34, "fontWeight": "w700", "height": 1.1},
"headlineLarge": {"fontSize": 30, "fontWeight": "w700", "height": 1.3},
"headlineMedium": {"fontSize": 26, "fontWeight": "w700", "height": 1.3},
"headlineSmall": {"fontSize": 23, "fontWeight": "w700", "height": 1.3},
"titleLarge": {"fontSize": 20, "fontWeight": "w500", "height": 1.3},
"titleMedium": {"fontSize": 18, "fontWeight": "w500", "height": 1.3},
"titleSmall": {"fontSize": 16, "fontWeight": "w500", "height": 1.3},
"labelLarge": {"fontSize": 16, "fontWeight": "w700", "height": 1.3},
"labelMedium": {"fontSize": 14, "fontWeight": "w600", "height": 1.3},
"labelSmall": {"fontSize": 12, "fontWeight": "w500", "height": 1.3},
"bodyLarge": {"fontSize": 18, "fontWeight": "w400", "height": 1.5},
"bodyMedium": {"fontSize": 16, "fontWeight": "w400", "height": 1.5},
"bodySmall": {"fontSize": 14, "fontWeight": "w400", "height": 1.5},
},
"filledButtonTheme": {
"minimumSize": {"width": 120, "height": 40},
"textStyle": {"fontSize": 16, "fontWeight": "w500", "height": 1.3},
"padding": {"left": 10, "right": 10, "top": 8, "bottom": 8},
"shape": {"type": "roundedRectangleBorder", "borderRadius": 8},
},
"outlinedButtonTheme": {
"minimumSize": {"width": 120, "height": 40},
"textStyle": {"fontSize": 16, "fontWeight": "w500", "height": 1.3},
"padding": {"left": 10, "right": 10, "top": 8, "bottom": 8},
"side": {"color": "#95E183", "width": 1.0},
"shape": {"type": "roundedRectangleBorder", "borderRadius": 8},
},
"dividerTheme": {"color": "#24FFFFFF", "thickness": 1},
};
Loading