Skip to content

Commit 5abe9ed

Browse files
authored
Merge pull request #151 from krolmic/feat/save-moods-locally
Feat/save moods locally
2 parents 60d3a2f + a690178 commit 5abe9ed

29 files changed

+800
-51
lines changed

tracking_flutter/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214
.vscode/launch.json
1315

tracking_flutter/ios/Podfile.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ PODS:
6161
- FirebaseCoreInternal (~> 11.0)
6262
- GoogleUtilities/Environment (~> 8.0)
6363
- GoogleUtilities/Logger (~> 8.0)
64-
- FirebaseCoreExtension (11.2.0):
64+
- FirebaseCoreExtension (11.4.1):
6565
- FirebaseCore (~> 11.0)
66-
- FirebaseCoreInternal (11.2.0):
66+
- FirebaseCoreInternal (11.7.0):
6767
- "GoogleUtilities/NSData+zlib (~> 8.0)"
6868
- FirebaseCrashlytics (11.0.0):
6969
- FirebaseCore (~> 11.0)
@@ -74,13 +74,13 @@ PODS:
7474
- GoogleUtilities/Environment (~> 8.0)
7575
- nanopb (~> 3.30910.0)
7676
- PromisesObjC (~> 2.4)
77-
- FirebaseInstallations (11.2.0):
77+
- FirebaseInstallations (11.4.0):
7878
- FirebaseCore (~> 11.0)
7979
- GoogleUtilities/Environment (~> 8.0)
8080
- GoogleUtilities/UserDefaults (~> 8.0)
8181
- PromisesObjC (~> 2.4)
82-
- FirebaseRemoteConfigInterop (11.2.0)
83-
- FirebaseSessions (11.2.0):
82+
- FirebaseRemoteConfigInterop (11.7.0)
83+
- FirebaseSessions (11.3.0):
8484
- FirebaseCore (~> 11.0)
8585
- FirebaseCoreExtension (~> 11.0)
8686
- FirebaseInstallations (~> 11.0)
@@ -142,9 +142,9 @@ PODS:
142142
- RevenueCat (5.3.1)
143143
- RevenueCatUI (5.3.1):
144144
- RevenueCat (= 5.3.1)
145-
- SDWebImage (5.19.7):
146-
- SDWebImage/Core (= 5.19.7)
147-
- SDWebImage/Core (5.19.7)
145+
- SDWebImage (5.20.0):
146+
- SDWebImage/Core (= 5.20.0)
147+
- SDWebImage/Core (5.20.0)
148148
- shared_preferences_foundation (0.0.1):
149149
- Flutter
150150
- FlutterMacOS
@@ -278,12 +278,12 @@ SPEC CHECKSUMS:
278278
firebase_core: ceec591a66629daaee82d3321551692c4a871493
279279
firebase_crashlytics: e4f04180f443d5a8b56fbc0685bdbd7d90dd26f0
280280
FirebaseCore: 3cf438f431f18c12cdf2aaf64434648b63f7e383
281-
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de
282-
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5
281+
FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e
282+
FirebaseCoreInternal: d6c17dafc8dc33614733a8b52df78fcb4394c881
283283
FirebaseCrashlytics: 745d8f0221fe49c62865391d1bf56f5a12eeec0b
284-
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a
285-
FirebaseRemoteConfigInterop: 477b26fdeb8fb5fbaf22fa9db5343b42289dc7db
286-
FirebaseSessions: adcec8b72d0066a385e3affcd1bcb1ebb3908ce6
284+
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
285+
FirebaseRemoteConfigInterop: ca12abf9da0003efd3a476b2dff4f7a04fd31b4f
286+
FirebaseSessions: 655ff17f3cc1a635cbdc2d69b953878001f9e25b
287287
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
288288
flutter_email_sender: 10a22605f92809a11ef52b2f412db806c6082d40
289289
flutter_fimber: ec011dfb08d7cbfa16ab6bad8450b99574e6f6a4
@@ -303,7 +303,7 @@ SPEC CHECKSUMS:
303303
PurchasesHybridCommonUI: fc8fa6ad78cfcdb6d82a8a865a8ae8b78724df53
304304
RevenueCat: b2d2555cbb1f4116d341af4c5f82269c8e4e499a
305305
RevenueCatUI: 59b63f64505eac217af31f596e1ce3583734bba6
306-
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
306+
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
307307
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
308308
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
309309
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
@@ -315,4 +315,4 @@ SPEC CHECKSUMS:
315315

316316
PODFILE CHECKSUM: ade96bceabe3919b69c16573938e4268fe3a6c9d
317317

318-
COCOAPODS: 1.15.2
318+
COCOAPODS: 1.16.2

tracking_flutter/lib/main.dart

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
66
import 'package:get_it/get_it.dart';
77
import 'package:graph_settings_repository/graph_settings_repository.dart';
88
import 'package:legal_repository/legal_repository.dart';
9+
import 'package:local_mood_repository/local_mood_repository.dart';
910
import 'package:mood_repository/mood_repository.dart';
1011
import 'package:serverpod_auth_shared_flutter/serverpod_auth_shared_flutter.dart';
1112
import 'package:serverpod_flutter/serverpod_flutter.dart';
@@ -32,20 +33,14 @@ final GetIt getIt = GetIt.instance;
3233

3334
Future<void> registerSingletons() async {
3435
final sharedPreferences = await SharedPreferences.getInstance();
35-
final serverpodClient = await initServerpodClient();
36+
await _registerMoodRepository();
3637

3738
getIt
3839
..registerSingleton<AmplifyClass>(Amplify)
3940
..registerSingleton<AuthCategory>(Amplify.Auth)
4041
..registerSingleton<SharedPreferences>(sharedPreferences)
41-
..registerSingleton<Client>(serverpodClient)
4242

4343
// Repositories
44-
..registerLazySingleton<MoodRepository>(
45-
() => MoodRepository(
46-
serverpodClient: getIt<Client>(),
47-
),
48-
)
4944
..registerLazySingleton<UserProfileRepository>(
5045
() => UserProfileRepository(
5146
amplifyAuth: getIt<AuthCategory>(),
@@ -80,7 +75,29 @@ Future<void> registerSingletons() async {
8075
);
8176
}
8277

83-
Future<Client> initServerpodClient() async {
78+
Future<void> _registerMoodRepository() async {
79+
const useServerpodForMoods = bool.fromEnvironment(
80+
'USE_SERVERPOD',
81+
);
82+
83+
if (useServerpodForMoods) {
84+
final serverpodClient = await _initServerpodClient();
85+
getIt
86+
..registerSingleton<Client>(serverpodClient)
87+
..registerLazySingleton<MoodRepository>(
88+
() => ServerpodMoodRepository(
89+
serverpodClient: getIt<Client>(),
90+
),
91+
);
92+
} else {
93+
final localMoodRepository = await LocalMoodRepository.initialize();
94+
getIt.registerLazySingleton<MoodRepository>(
95+
() => localMoodRepository,
96+
);
97+
}
98+
}
99+
100+
Future<Client> _initServerpodClient() async {
84101
final serverpodClient = Client(
85102
const String.fromEnvironment('API_URL'),
86103
authenticationKeyManager: FlutterAuthenticationKeyManager(),
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: "fix: "
5+
labels: bug
6+
---
7+
8+
**Description**
9+
10+
A clear and concise description of what the bug is.
11+
12+
**Steps To Reproduce**
13+
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected Behavior**
20+
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
25+
If applicable, add screenshots to help explain your problem.
26+
27+
**Additional Context**
28+
29+
Add any other context about the problem here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Build System
3+
about: Changes that affect the build system or external dependencies
4+
title: "build: "
5+
labels: build
6+
---
7+
8+
**Description**
9+
10+
Describe what changes need to be done to the build system and why.
11+
12+
**Requirements**
13+
14+
- [ ] The build system is passing
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Chore
3+
about: Other changes that don't modify src or test files
4+
title: "chore: "
5+
labels: chore
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what change is needed and why. If this changes code then please use another issue type.
11+
12+
**Requirements**
13+
14+
- [ ] No functional changes to the code
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Continuous Integration
3+
about: Changes to the CI configuration files and scripts
4+
title: "ci: "
5+
labels: ci
6+
---
7+
8+
**Description**
9+
10+
Describe what changes need to be done to the ci/cd system and why.
11+
12+
**Requirements**
13+
14+
- [ ] The ci system is passing
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Documentation
3+
about: Improve the documentation so all collaborators have a common understanding
4+
title: "docs: "
5+
labels: documentation
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what documentation you are looking to add or improve.
11+
12+
**Requirements**
13+
14+
- [ ] Requirements go here
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature Request
3+
about: A new feature to be added to the project
4+
title: "feat: "
5+
labels: feature
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what you are looking to add. The more context the better.
11+
12+
**Requirements**
13+
14+
- [ ] Checklist of requirements to be fulfilled
15+
16+
**Additional Context**
17+
18+
Add any other context or screenshots about the feature request go here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Performance Update
3+
about: A code change that improves performance
4+
title: "perf: "
5+
labels: performance
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what code needs to be changed and what the performance impact is going to be. Bonus point's if you can tie this directly to user experience.
11+
12+
**Requirements**
13+
14+
- [ ] There is no drop in test coverage.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Refactor
3+
about: A code change that neither fixes a bug nor adds a feature
4+
title: "refactor: "
5+
labels: refactor
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what needs to be refactored and why. Please provide links to related issues (bugs or upcoming features) in order to help prioritize.
11+
12+
**Requirements**
13+
14+
- [ ] There is no drop in test coverage.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Revert Commit
3+
about: Reverts a previous commit
4+
title: "revert: "
5+
labels: revert
6+
---
7+
8+
**Description**
9+
10+
Provide a link to a PR/Commit that you are looking to revert and why.
11+
12+
**Requirements**
13+
14+
- [ ] Change has been reverted
15+
- [ ] No change in test coverage has happened
16+
- [ ] A new ticket is created for any follow on work that needs to happen
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Style Changes
3+
about: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc)
4+
title: "style: "
5+
labels: style
6+
---
7+
8+
**Description**
9+
10+
Clearly describe what you are looking to change and why.
11+
12+
**Requirements**
13+
14+
- [ ] There is no drop in test coverage.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Test
3+
about: Adding missing tests or correcting existing tests
4+
title: "test: "
5+
labels: test
6+
---
7+
8+
**Description**
9+
10+
List out the tests that need to be added or changed. Please also include any information as to why this was not covered in the past.
11+
12+
**Requirements**
13+
14+
- [ ] There is no drop in test coverage.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
Thanks for contributing!
3+
4+
Provide a description of your changes below and a general summary in the title
5+
6+
Please look at the following checklist to ensure that your PR can be accepted quickly:
7+
-->
8+
9+
## Status
10+
11+
**READY/IN DEVELOPMENT/HOLD**
12+
13+
## Description
14+
15+
<!--- Describe your changes in detail -->
16+
17+
## Type of Change
18+
19+
<!--- Put an `x` in all the boxes that apply: -->
20+
21+
- [ ] ✨ New feature (non-breaking change which adds functionality)
22+
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
23+
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
24+
- [ ] 🧹 Code refactor
25+
- [ ] ✅ Build configuration change
26+
- [ ] 📝 Documentation
27+
- [ ] 🗑️ Chore
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": "0.2",
3+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
4+
"dictionaries": ["vgv_allowed", "vgv_forbidden"],
5+
"dictionaryDefinitions": [
6+
{
7+
"name": "vgv_allowed",
8+
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/allowed.txt",
9+
"description": "Allowed VGV Spellings"
10+
},
11+
{
12+
"name": "vgv_forbidden",
13+
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/forbidden.txt",
14+
"description": "Forbidden VGV Spellings"
15+
}
16+
],
17+
"useGitignore": true,
18+
"words": [
19+
"local_mood_repository"
20+
]
21+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
enable-beta-ecosystems: true
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
- package-ecosystem: "pub"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"

0 commit comments

Comments
 (0)