Skip to content

Commit 2876dbf

Browse files
authored
Merge pull request #4 from tassid/feat/profile
2 parents 2c51ba6 + 6f4327a commit 2876dbf

19 files changed

+422
-107
lines changed

firebase.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"flutter":{"platforms":{"ios":{"default":{"projectId":"app-streaming-tds","appId":"1:135973407805:ios:072a5dd124d9cb1900ee54","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"macos":{"default":{"projectId":"app-streaming-tds","appId":"1:135973407805:ios:072a5dd124d9cb1900ee54","uploadDebugSymbols":false,"fileOutput":"macos/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"app-streaming-tds","configurations":{"ios":"1:135973407805:ios:072a5dd124d9cb1900ee54","macos":"1:135973407805:ios:072a5dd124d9cb1900ee54","web":"1:135973407805:web:20d0085d5df4a1ea00ee54"}}}}}}

ios/Podfile.lock

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
PODS:
2+
- Firebase/Auth (10.25.0):
3+
- Firebase/CoreOnly
4+
- FirebaseAuth (~> 10.25.0)
5+
- Firebase/CoreOnly (10.25.0):
6+
- FirebaseCore (= 10.25.0)
7+
- firebase_auth (4.20.0):
8+
- Firebase/Auth (= 10.25.0)
9+
- firebase_core
10+
- Flutter
11+
- firebase_core (2.32.0):
12+
- Firebase/CoreOnly (= 10.25.0)
13+
- Flutter
14+
- FirebaseAppCheckInterop (10.29.0)
15+
- FirebaseAuth (10.25.0):
16+
- FirebaseAppCheckInterop (~> 10.17)
17+
- FirebaseCore (~> 10.0)
18+
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
19+
- GoogleUtilities/Environment (~> 7.8)
20+
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
21+
- RecaptchaInterop (~> 100.0)
22+
- FirebaseCore (10.25.0):
23+
- FirebaseCoreInternal (~> 10.0)
24+
- GoogleUtilities/Environment (~> 7.12)
25+
- GoogleUtilities/Logger (~> 7.12)
26+
- FirebaseCoreInternal (10.29.0):
27+
- "GoogleUtilities/NSData+zlib (~> 7.8)"
228
- Flutter (1.0.0)
329
- flutter_inappwebview (0.0.1):
430
- Flutter
@@ -7,17 +33,44 @@ PODS:
733
- flutter_inappwebview/Core (0.0.1):
834
- Flutter
935
- OrderedSet (~> 5.0)
36+
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
37+
- GoogleUtilities/Environment
38+
- GoogleUtilities/Logger
39+
- GoogleUtilities/Network
40+
- GoogleUtilities/Privacy
41+
- GoogleUtilities/Environment (7.13.3):
42+
- GoogleUtilities/Privacy
43+
- PromisesObjC (< 3.0, >= 1.2)
44+
- GoogleUtilities/Logger (7.13.3):
45+
- GoogleUtilities/Environment
46+
- GoogleUtilities/Privacy
47+
- GoogleUtilities/Network (7.13.3):
48+
- GoogleUtilities/Logger
49+
- "GoogleUtilities/NSData+zlib"
50+
- GoogleUtilities/Privacy
51+
- GoogleUtilities/Reachability
52+
- "GoogleUtilities/NSData+zlib (7.13.3)":
53+
- GoogleUtilities/Privacy
54+
- GoogleUtilities/Privacy (7.13.3)
55+
- GoogleUtilities/Reachability (7.13.3):
56+
- GoogleUtilities/Logger
57+
- GoogleUtilities/Privacy
58+
- GTMSessionFetcher/Core (3.5.0)
1059
- OrderedSet (5.0.0)
1160
- path_provider_foundation (0.0.1):
1261
- Flutter
1362
- FlutterMacOS
63+
- PromisesObjC (2.4.0)
64+
- RecaptchaInterop (100.0.0)
1465
- sqflite (0.0.3):
1566
- Flutter
1667
- FlutterMacOS
1768
- url_launcher_ios (0.0.1):
1869
- Flutter
1970

2071
DEPENDENCIES:
72+
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
73+
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
2174
- Flutter (from `Flutter`)
2275
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
2376
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
@@ -26,9 +79,22 @@ DEPENDENCIES:
2679

2780
SPEC REPOS:
2881
trunk:
82+
- Firebase
83+
- FirebaseAppCheckInterop
84+
- FirebaseAuth
85+
- FirebaseCore
86+
- FirebaseCoreInternal
87+
- GoogleUtilities
88+
- GTMSessionFetcher
2989
- OrderedSet
90+
- PromisesObjC
91+
- RecaptchaInterop
3092

3193
EXTERNAL SOURCES:
94+
firebase_auth:
95+
:path: ".symlinks/plugins/firebase_auth/ios"
96+
firebase_core:
97+
:path: ".symlinks/plugins/firebase_core/ios"
3298
Flutter:
3399
:path: Flutter
34100
flutter_inappwebview:
@@ -41,10 +107,21 @@ EXTERNAL SOURCES:
41107
:path: ".symlinks/plugins/url_launcher_ios/ios"
42108

43109
SPEC CHECKSUMS:
110+
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
111+
firebase_auth: 5719ddc9f654b813405899480e84971bd8e61235
112+
firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197
113+
FirebaseAppCheckInterop: 6a1757cfd4067d8e00fccd14fcc1b8fd78cfac07
114+
FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb
115+
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483
116+
FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
44117
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
45118
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
119+
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
120+
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
46121
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
47122
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
123+
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
124+
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
48125
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
49126
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
50127

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
19+
D1B1F667D10EEFE002D99CF9 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = ECCC5227A7A27A6ADFE3B81D /* GoogleService-Info.plist */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXContainerItemProxy section */
@@ -65,6 +66,7 @@
6566
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6667
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6768
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
69+
ECCC5227A7A27A6ADFE3B81D /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
6870
/* End PBXFileReference section */
6971

7072
/* Begin PBXFrameworksBuildPhase section */
@@ -129,6 +131,7 @@
129131
331C8082294A63A400263BE5 /* RunnerTests */,
130132
8D428AFFB1EFAD5DF28C4F4D /* Pods */,
131133
CA2C8C3A65AC98EABDCE9842 /* Frameworks */,
134+
ECCC5227A7A27A6ADFE3B81D /* GoogleService-Info.plist */,
132135
);
133136
sourceTree = "<group>";
134137
};
@@ -264,6 +267,7 @@
264267
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
265268
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
266269
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
270+
D1B1F667D10EEFE002D99CF9 /* GoogleService-Info.plist in Resources */,
267271
);
268272
runOnlyForDeploymentPostprocessing = 0;
269273
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>API_KEY</key>
6+
<string>AIzaSyBJoEF_BgDNeSzr3AygwBF23Fn1WFT0X-E</string>
7+
<key>GCM_SENDER_ID</key>
8+
<string>135973407805</string>
9+
<key>PLIST_VERSION</key>
10+
<string>1</string>
11+
<key>BUNDLE_ID</key>
12+
<string>com.example.appStreaming</string>
13+
<key>PROJECT_ID</key>
14+
<string>app-streaming-tds</string>
15+
<key>STORAGE_BUCKET</key>
16+
<string>app-streaming-tds.appspot.com</string>
17+
<key>IS_ADS_ENABLED</key>
18+
<false></false>
19+
<key>IS_ANALYTICS_ENABLED</key>
20+
<false></false>
21+
<key>IS_APPINVITE_ENABLED</key>
22+
<true></true>
23+
<key>IS_GCM_ENABLED</key>
24+
<true></true>
25+
<key>IS_SIGNIN_ENABLED</key>
26+
<true></true>
27+
<key>GOOGLE_APP_ID</key>
28+
<string>1:135973407805:ios:072a5dd124d9cb1900ee54</string>
29+
</dict>
30+
</plist>

lib/firebase_options.dart

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// File generated by FlutterFire CLI.
2+
// ignore_for_file: type=lint
3+
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4+
import 'package:flutter/foundation.dart'
5+
show defaultTargetPlatform, kIsWeb, TargetPlatform;
6+
7+
/// Default [FirebaseOptions] for use with your Firebase apps.
8+
///
9+
/// Example:
10+
/// ```dart
11+
/// import 'firebase_options.dart';
12+
/// // ...
13+
/// await Firebase.initializeApp(
14+
/// options: DefaultFirebaseOptions.currentPlatform,
15+
/// );
16+
/// ```
17+
class DefaultFirebaseOptions {
18+
static FirebaseOptions get currentPlatform {
19+
if (kIsWeb) {
20+
return web;
21+
}
22+
switch (defaultTargetPlatform) {
23+
case TargetPlatform.android:
24+
throw UnsupportedError(
25+
'DefaultFirebaseOptions have not been configured for android - '
26+
'you can reconfigure this by running the FlutterFire CLI again.',
27+
);
28+
case TargetPlatform.iOS:
29+
return ios;
30+
case TargetPlatform.macOS:
31+
return macos;
32+
case TargetPlatform.windows:
33+
throw UnsupportedError(
34+
'DefaultFirebaseOptions have not been configured for windows - '
35+
'you can reconfigure this by running the FlutterFire CLI again.',
36+
);
37+
case TargetPlatform.linux:
38+
throw UnsupportedError(
39+
'DefaultFirebaseOptions have not been configured for linux - '
40+
'you can reconfigure this by running the FlutterFire CLI again.',
41+
);
42+
default:
43+
throw UnsupportedError(
44+
'DefaultFirebaseOptions are not supported for this platform.',
45+
);
46+
}
47+
}
48+
49+
static const FirebaseOptions web = FirebaseOptions(
50+
apiKey: 'AIzaSyCS6Cb3TIf5inKryFVdljoKnK22lNMLMRg',
51+
appId: '1:135973407805:web:20d0085d5df4a1ea00ee54',
52+
messagingSenderId: '135973407805',
53+
projectId: 'app-streaming-tds',
54+
authDomain: 'app-streaming-tds.firebaseapp.com',
55+
storageBucket: 'app-streaming-tds.appspot.com',
56+
measurementId: 'G-4D6TGW0TQD',
57+
);
58+
59+
static const FirebaseOptions ios = FirebaseOptions(
60+
apiKey: 'AIzaSyBJoEF_BgDNeSzr3AygwBF23Fn1WFT0X-E',
61+
appId: '1:135973407805:ios:072a5dd124d9cb1900ee54',
62+
messagingSenderId: '135973407805',
63+
projectId: 'app-streaming-tds',
64+
storageBucket: 'app-streaming-tds.appspot.com',
65+
iosBundleId: 'com.example.appStreaming',
66+
);
67+
68+
static const FirebaseOptions macos = FirebaseOptions(
69+
apiKey: 'AIzaSyBJoEF_BgDNeSzr3AygwBF23Fn1WFT0X-E',
70+
appId: '1:135973407805:ios:072a5dd124d9cb1900ee54',
71+
messagingSenderId: '135973407805',
72+
projectId: 'app-streaming-tds',
73+
storageBucket: 'app-streaming-tds.appspot.com',
74+
iosBundleId: 'com.example.appStreaming',
75+
);
76+
}

lib/main.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
import 'package:app_streaming/firebase_options.dart';
2+
import 'package:firebase_core/firebase_core.dart';
3+
import 'package:flutter/material.dart';
14
import 'package:app_streaming/views/home/home_page.dart';
25
import 'package:app_streaming/views/home/movies_page.dart';
36
import 'package:app_streaming/views/home/tvshows_page.dart';
47
import 'package:app_streaming/views/login/login_page.dart';
8+
import 'package:app_streaming/views/login/whos_watching_page.dart';
59
import 'package:app_streaming/views/onboarding/onboarding_page.dart';
610
import 'package:app_streaming/views/onboarding/splash_page.dart';
7-
import 'package:app_streaming/views/login/whos_watching_page.dart';
8-
import 'package:flutter/material.dart';
911

10-
void main() {
12+
void main() async {
13+
WidgetsFlutterBinding.ensureInitialized();
14+
await Firebase.initializeApp(
15+
options: DefaultFirebaseOptions.currentPlatform,
16+
);
17+
1118
runApp(
1219
MaterialApp(
1320
themeMode: ThemeMode.dark,

lib/models/user_profile.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ class UserProfile {
1010
UserProfile({
1111
required this.name,
1212
this.avatarUrl,
13+
int? seed,
1314
}) {
14-
color = _generateColor();
15+
color = _generateColor(seed: seed);
1516
}
1617

17-
Color _generateColor() {
18-
final Random random = Random();
18+
Color _generateColor({int? seed}) {
19+
final Random random = seed != null ? Random(seed) : Random();
1920
Color randomColor = Colors.red;
2021

2122
while (!randomColor.isColorContrastingWithWhite()) {

lib/views/home/bars/app_bar.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:app_streaming/models/categories.dart';
22
import 'package:app_streaming/views/home/bars/categories_bar.dart';
3+
import 'package:app_streaming/views/home/profile_edit_page.dart';
34
import 'package:app_streaming/views/home/search/search_page.dart';
45
import 'package:flutter/material.dart';
56
import 'dart:ui';
@@ -19,6 +20,8 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
1920
@override
2021
Size get preferredSize => const Size.fromHeight(130);
2122

23+
get profile => null;
24+
2225
@override
2326
Widget build(BuildContext context) {
2427
return Stack(
@@ -69,7 +72,15 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
6972
IconButton(
7073
icon: const Icon(Icons.account_circle,
7174
color: Colors.white),
72-
onPressed: () {},
75+
onPressed: () {
76+
Navigator.push(
77+
context,
78+
MaterialPageRoute(
79+
builder: (context) =>
80+
EditProfilePage(profile: profile),
81+
),
82+
);
83+
},
7384
),
7485
],
7586
),

lib/views/home/home_page.dart

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ class _HomePageState extends State<HomePage> {
3333
}
3434

3535
void _fetchMoviesByCategory(Category category) {
36-
// Fetch movies based on the selected category
3736
setState(() {
3837
_categoryMovies = _apiService.fetchMovies(category.apiCategoryId);
3938
});
4039

41-
// Add debugging to check the API response
4240
_categoryMovies.then((movies) {
4341
if (movies.isEmpty) {
4442
print('No movies returned for category: ${category.categoryName}');
@@ -108,6 +106,24 @@ class _HomePageState extends State<HomePage> {
108106
);
109107
}
110108

109+
Widget _buildTopSection(Future<List<Movie>> categoryMovies) {
110+
return FutureBuilder<List<Movie>>(
111+
future: categoryMovies,
112+
builder: (context, snapshot) {
113+
if (snapshot.connectionState == ConnectionState.waiting) {
114+
return const Center(child: CircularProgressIndicator());
115+
} else if (snapshot.hasError) {
116+
return Center(child: Text('Error: ${snapshot.error}'));
117+
} else if (!snapshot.hasData || snapshot.data!.isEmpty) {
118+
return const Center(child: Text('No movies available'));
119+
} else {
120+
final movie = snapshot.data!.first;
121+
return MovieBanner(movie: movie);
122+
}
123+
},
124+
);
125+
}
126+
111127
@override
112128
Widget build(BuildContext context) {
113129
return Scaffold(
@@ -120,21 +136,7 @@ class _HomePageState extends State<HomePage> {
120136
child: Column(
121137
crossAxisAlignment: CrossAxisAlignment.start,
122138
children: [
123-
FutureBuilder<List<Movie>>(
124-
future: _categoryMovies,
125-
builder: (context, snapshot) {
126-
if (snapshot.connectionState == ConnectionState.waiting) {
127-
return const Center(child: CircularProgressIndicator());
128-
} else if (snapshot.hasError) {
129-
return Center(child: Text('Error: ${snapshot.error}'));
130-
} else if (!snapshot.hasData || snapshot.data!.isEmpty) {
131-
return const Center(child: Text('No movies available'));
132-
} else {
133-
final movie = snapshot.data!.first;
134-
return MovieBanner(movie: movie);
135-
}
136-
},
137-
),
139+
_buildTopSection(_categoryMovies),
138140
_buildMovieCarousel(_categoryMovies),
139141
],
140142
),

0 commit comments

Comments
 (0)