Skip to content

Commit bbf1ce4

Browse files
committed
feat: add top 3 emotion provider
1 parent 6defbfd commit bbf1ce4

12 files changed

Lines changed: 557 additions & 215 deletions

File tree

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2828
flutter_ios_podfile_setup
2929

3030
target 'Runner' do
31-
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.7.0'
31+
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.10.0'
3232
use_frameworks!
3333
use_modular_headers!
3434

ios/Podfile.lock

Lines changed: 83 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,77 @@
11
PODS:
2-
- cloud_firestore (5.6.3):
3-
- Firebase/Firestore (= 11.7.0)
2+
- cloud_firestore (5.6.7):
3+
- Firebase/Firestore (= 11.10.0)
44
- firebase_core
55
- Flutter
6+
- connectivity_plus (0.0.1):
7+
- Flutter
68
- desktop_webview_auth (0.0.1):
79
- Flutter
8-
- Firebase/Auth (11.7.0):
10+
- Firebase/Auth (11.10.0):
911
- Firebase/CoreOnly
10-
- FirebaseAuth (~> 11.7.0)
11-
- Firebase/CoreOnly (11.7.0):
12-
- FirebaseCore (~> 11.7.0)
13-
- Firebase/DynamicLinks (11.7.0):
12+
- FirebaseAuth (~> 11.10.0)
13+
- Firebase/CoreOnly (11.10.0):
14+
- FirebaseCore (~> 11.10.0)
15+
- Firebase/DynamicLinks (11.10.0):
1416
- Firebase/CoreOnly
15-
- FirebaseDynamicLinks (~> 11.7.0)
16-
- Firebase/Firestore (11.7.0):
17+
- FirebaseDynamicLinks (~> 11.10.0)
18+
- Firebase/Firestore (11.10.0):
1719
- Firebase/CoreOnly
18-
- FirebaseFirestore (~> 11.7.0)
19-
- firebase_auth (5.4.2):
20-
- Firebase/Auth (= 11.7.0)
20+
- FirebaseFirestore (~> 11.10.0)
21+
- firebase_auth (5.5.3):
22+
- Firebase/Auth (= 11.10.0)
2123
- firebase_core
2224
- Flutter
23-
- firebase_core (3.11.0):
24-
- Firebase/CoreOnly (= 11.7.0)
25+
- firebase_core (3.13.0):
26+
- Firebase/CoreOnly (= 11.10.0)
2527
- Flutter
26-
- firebase_dynamic_links (6.1.2):
27-
- Firebase/DynamicLinks (= 11.7.0)
28+
- firebase_dynamic_links (6.1.5):
29+
- Firebase/DynamicLinks (= 11.10.0)
2830
- firebase_core
2931
- Flutter
30-
- FirebaseAppCheckInterop (11.8.0)
31-
- FirebaseAuth (11.7.0):
32+
- FirebaseAppCheckInterop (11.12.0)
33+
- FirebaseAuth (11.10.0):
3234
- FirebaseAppCheckInterop (~> 11.0)
3335
- FirebaseAuthInterop (~> 11.0)
34-
- FirebaseCore (~> 11.7.0)
35-
- FirebaseCoreExtension (~> 11.7.0)
36+
- FirebaseCore (~> 11.10.0)
37+
- FirebaseCoreExtension (~> 11.10.0)
3638
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
3739
- GoogleUtilities/Environment (~> 8.0)
3840
- GTMSessionFetcher/Core (< 5.0, >= 3.4)
39-
- RecaptchaInterop (~> 100.0)
40-
- FirebaseAuthInterop (11.8.0)
41-
- FirebaseCore (11.7.0):
42-
- FirebaseCoreInternal (~> 11.7.0)
41+
- RecaptchaInterop (~> 101.0)
42+
- FirebaseAuthInterop (11.12.0)
43+
- FirebaseCore (11.10.0):
44+
- FirebaseCoreInternal (~> 11.10.0)
4345
- GoogleUtilities/Environment (~> 8.0)
4446
- GoogleUtilities/Logger (~> 8.0)
45-
- FirebaseCoreExtension (11.7.0):
46-
- FirebaseCore (~> 11.7.0)
47-
- FirebaseCoreInternal (11.7.0):
47+
- FirebaseCoreExtension (11.10.0):
48+
- FirebaseCore (~> 11.10.0)
49+
- FirebaseCoreInternal (11.10.0):
4850
- "GoogleUtilities/NSData+zlib (~> 8.0)"
49-
- FirebaseDynamicLinks (11.7.0):
50-
- FirebaseCore (~> 11.7.0)
51-
- FirebaseFirestore (11.7.0):
52-
- FirebaseFirestoreBinary (= 11.7.0)
53-
- FirebaseFirestoreAbseilBinary (1.2024011602.0)
54-
- FirebaseFirestoreBinary (11.7.0):
55-
- FirebaseCore (= 11.7.0)
56-
- FirebaseCoreExtension (= 11.7.0)
57-
- FirebaseFirestoreInternalBinary (= 11.7.0)
58-
- FirebaseSharedSwift (= 11.7.0)
59-
- FirebaseFirestoreGRPCBoringSSLBinary (1.65.1)
60-
- FirebaseFirestoreGRPCCoreBinary (1.65.1):
61-
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
62-
- FirebaseFirestoreGRPCBoringSSLBinary (= 1.65.1)
63-
- FirebaseFirestoreGRPCCPPBinary (1.65.1):
64-
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
65-
- FirebaseFirestoreGRPCCoreBinary (= 1.65.1)
66-
- FirebaseFirestoreInternalBinary (11.7.0):
67-
- FirebaseCore (= 11.7.0)
68-
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
69-
- FirebaseFirestoreGRPCCPPBinary (= 1.65.1)
51+
- FirebaseDynamicLinks (11.10.0):
52+
- FirebaseCore (~> 11.10.0)
53+
- FirebaseFirestore (11.10.0):
54+
- FirebaseFirestoreBinary (= 11.10.0)
55+
- FirebaseFirestoreAbseilBinary (1.2024072200.0)
56+
- FirebaseFirestoreBinary (11.10.0):
57+
- FirebaseCore (= 11.10.0)
58+
- FirebaseCoreExtension (= 11.10.0)
59+
- FirebaseFirestoreInternalBinary (= 11.10.0)
60+
- FirebaseSharedSwift (= 11.10.0)
61+
- FirebaseFirestoreGRPCBoringSSLBinary (1.69.0)
62+
- FirebaseFirestoreGRPCCoreBinary (1.69.0):
63+
- FirebaseFirestoreAbseilBinary (= 1.2024072200.0)
64+
- FirebaseFirestoreGRPCBoringSSLBinary (= 1.69.0)
65+
- FirebaseFirestoreGRPCCPPBinary (1.69.0):
66+
- FirebaseFirestoreAbseilBinary (= 1.2024072200.0)
67+
- FirebaseFirestoreGRPCCoreBinary (= 1.69.0)
68+
- FirebaseFirestoreInternalBinary (11.10.0):
69+
- FirebaseCore (= 11.10.0)
70+
- FirebaseFirestoreAbseilBinary (= 1.2024072200.0)
71+
- FirebaseFirestoreGRPCCPPBinary (= 1.69.0)
7072
- leveldb-library (~> 1.22)
7173
- nanopb (~> 3.30910.0)
72-
- FirebaseSharedSwift (11.7.0)
74+
- FirebaseSharedSwift (11.10.0)
7375
- Flutter (1.0.0)
7476
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
7577
- GoogleUtilities/Environment
@@ -92,7 +94,7 @@ PODS:
9294
- GoogleUtilities/Reachability (8.0.2):
9395
- GoogleUtilities/Logger
9496
- GoogleUtilities/Privacy
95-
- GTMSessionFetcher/Core (4.3.0)
97+
- GTMSessionFetcher/Core (4.4.0)
9698
- leveldb-library (1.22.6)
9799
- nanopb (3.30910.0):
98100
- nanopb/decode (= 3.30910.0)
@@ -101,7 +103,7 @@ PODS:
101103
- nanopb/encode (3.30910.0)
102104
- package_info_plus (0.4.5):
103105
- Flutter
104-
- RecaptchaInterop (100.0.0)
106+
- RecaptchaInterop (101.0.0)
105107
- shared_preferences_foundation (0.0.1):
106108
- Flutter
107109
- FlutterMacOS
@@ -110,11 +112,12 @@ PODS:
110112

111113
DEPENDENCIES:
112114
- cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
115+
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
113116
- desktop_webview_auth (from `.symlinks/plugins/desktop_webview_auth/ios`)
114117
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
115118
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
116119
- firebase_dynamic_links (from `.symlinks/plugins/firebase_dynamic_links/ios`)
117-
- FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.7.0`)
120+
- FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.10.0`)
118121
- Flutter (from `Flutter`)
119122
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
120123
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
@@ -146,6 +149,8 @@ SPEC REPOS:
146149
EXTERNAL SOURCES:
147150
cloud_firestore:
148151
:path: ".symlinks/plugins/cloud_firestore/ios"
152+
connectivity_plus:
153+
:path: ".symlinks/plugins/connectivity_plus/ios"
149154
desktop_webview_auth:
150155
:path: ".symlinks/plugins/desktop_webview_auth/ios"
151156
firebase_auth:
@@ -156,7 +161,7 @@ EXTERNAL SOURCES:
156161
:path: ".symlinks/plugins/firebase_dynamic_links/ios"
157162
FirebaseFirestore:
158163
:git: https://github.com/invertase/firestore-ios-sdk-frameworks.git
159-
:tag: 11.7.0
164+
:tag: 11.10.0
160165
Flutter:
161166
:path: Flutter
162167
package_info_plus:
@@ -169,40 +174,41 @@ EXTERNAL SOURCES:
169174
CHECKOUT OPTIONS:
170175
FirebaseFirestore:
171176
:git: https://github.com/invertase/firestore-ios-sdk-frameworks.git
172-
:tag: 11.7.0
177+
:tag: 11.10.0
173178

174179
SPEC CHECKSUMS:
175-
cloud_firestore: 75151f94e2adb9685d6133d6cd06bb2d9026604e
180+
cloud_firestore: d959b9b44fb0619e8c88e1b7436d3b1d36b4984e
181+
connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
176182
desktop_webview_auth: d645139460ef203d50bd0cdb33356785dd939cce
177-
Firebase: a64bf6a8546e6eab54f1c715cd6151f39d2329f4
178-
firebase_auth: bcc25c2992fb3e655b59faca6f0f5bc9215d463d
179-
firebase_core: aa979ae726f00b3ef4ccf59dfb96170af84efbd4
180-
firebase_dynamic_links: de96307a996b1c92b3b715f683ed5e320ad3c033
181-
FirebaseAppCheckInterop: 7bf86d55a2b7e9bd91464120eba3e52e4b63b2e2
182-
FirebaseAuth: 77e25aa24f3e1c626c5babd3338551fc1669ee0e
183-
FirebaseAuthInterop: 651756e70d9a0b9160db39ead71fd5507dbb6c84
184-
FirebaseCore: 3227e35f4197a924206fbcdc0349325baf4f5de4
185-
FirebaseCoreExtension: 206c1b399f0d103055207c16f299b28e3dbd1949
186-
FirebaseCoreInternal: d6c17dafc8dc33614733a8b52df78fcb4394c881
187-
FirebaseDynamicLinks: e81e03f6076bd02081ae6e06631797e134380a76
188-
FirebaseFirestore: 61305c5ac196ec1526dde68ac132543a7749a081
189-
FirebaseFirestoreAbseilBinary: fa2ebd2ed02cadef5382e4f7c93f1b265c812c85
190-
FirebaseFirestoreBinary: 86eaad2ff00b789242734496029a3d08d4d86a89
191-
FirebaseFirestoreGRPCBoringSSLBinary: d86ebbe2adc8d15d7ebf305fff7d6358385327f8
192-
FirebaseFirestoreGRPCCoreBinary: 472bd808e1886a5efb2fd03dd09b98d34641a335
193-
FirebaseFirestoreGRPCCPPBinary: db76d83d2b7517623f8426ed7f7a17bad2478084
194-
FirebaseFirestoreInternalBinary: 1850c8c72f3d7933a00a4d0bae88021df87c9e10
195-
FirebaseSharedSwift: a45efd84d60ebbfdcdbaebc66948af3630459e62
183+
Firebase: 1fe1c0a7d9aaea32efe01fbea5f0ebd8d70e53a2
184+
firebase_auth: 3f532201cbdc7cd6dfc3bfa89affc0c294111e20
185+
firebase_core: 432718558359a8c08762151b5f49bb0f093eb6e0
186+
firebase_dynamic_links: f1ea6defe555a0e140f6a42cfc45b96ed8d5204d
187+
FirebaseAppCheckInterop: 73b173e5ec45192e2d522ad43f526a82ad10b852
188+
FirebaseAuth: c4146bdfdc87329f9962babd24dae89373f49a32
189+
FirebaseAuthInterop: b583210c039a60ed3f1e48865e1f3da44a796595
190+
FirebaseCore: 8344daef5e2661eb004b177488d6f9f0f24251b7
191+
FirebaseCoreExtension: 6f357679327f3614e995dc7cf3f2d600bdc774ac
192+
FirebaseCoreInternal: ef4505d2afb1d0ebbc33162cb3795382904b5679
193+
FirebaseDynamicLinks: a76f75ddb0612301c34b3f598100449b41bc2669
194+
FirebaseFirestore: e5c3d65fef6c6e07c47af2130aaadfb89dd07ea7
195+
FirebaseFirestoreAbseilBinary: 4cfa8823cedc1b774843e04fe578ad279b387f97
196+
FirebaseFirestoreBinary: 6cf15472267bbb89ce9ac5e645eb0abae29208ce
197+
FirebaseFirestoreGRPCBoringSSLBinary: c3dfef3ff448ae2c1c85f9baf9fac5afc4db99fa
198+
FirebaseFirestoreGRPCCoreBinary: 565534e160a0415d12185f7f171c52a567382fbd
199+
FirebaseFirestoreGRPCCPPBinary: 6c0134e8d230ee58b9d51dec2a30a48efd6d5dc7
200+
FirebaseFirestoreInternalBinary: 96b309279c4efdf00b83ab80e8af4d0a73d30258
201+
FirebaseSharedSwift: 1baacae75939499b5def867cbe34129464536a38
196202
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
197203
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
198-
GTMSessionFetcher: 257ead9ba8e15a2d389d79496e02b9cc5dd0c62c
204+
GTMSessionFetcher: 75b671f9e551e4c49153d4c4f8659ef4f559b970
199205
leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19
200206
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
201207
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
202-
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
208+
RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba
203209
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
204210
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
205211

206-
PODFILE CHECKSUM: c70cad528bc2dff4479290bb137f19fe65bb7e08
212+
PODFILE CHECKSUM: 0ef55e92992619dc596d30dc3ec1693fb16d22a7
207213

208214
COCOAPODS: 1.16.2

lib/src/features/authentication/presentation/custom_sign_in_screen.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class CustomSignInScreen extends ConsumerWidget {
1818
),
1919
body: SignInScreen(
2020
providers: authProviders,
21-
footerBuilder: (context, action) => const SignInAnonymouslyFooter(),
2221
),
2322
);
2423
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:flutter_riverpod/flutter_riverpod.dart';
2+
import 'package:illemo/src/features/emotions/data/repositories/emotion_repository.dart';
3+
import 'package:illemo/src/features/emotions/domain/models/emotion.dart';
4+
import 'package:riverpod_annotation/riverpod_annotation.dart';
5+
6+
part 'emotion_stats.g.dart';
7+
8+
@riverpod
9+
Stream<List<Emotion>> getTopEmotions(Ref ref, DateTime startDate, DateTime endDate) {
10+
final EmotionRepository emotionRepository = ref.watch(emotionRepositoryProvider);
11+
final emotionsStream =
12+
emotionRepository.getEmotionLogs(startDate: startDate, endDate: endDate).map((logs) {
13+
// Process the logs to get the top emotions
14+
final topEmotions = logs.fold<Map<Emotion, int>>({}, (acc, log) {
15+
for (final emotion in log.emotions) {
16+
acc[emotion] = (acc[emotion] ?? 0) + 1;
17+
}
18+
return acc;
19+
});
20+
21+
// Sort the emotions by count and take the top 3
22+
final sortedEmotions = topEmotions.entries.toList()..sort((a, b) => b.value.compareTo(a.value));
23+
return sortedEmotions.take(3).map((entry) => entry.key).toList();
24+
});
25+
return emotionsStream;
26+
}

0 commit comments

Comments
 (0)