Skip to content
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

[Mobile App] Code Cleanup & Enhancements #1037

Merged
merged 22 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
9 changes: 5 additions & 4 deletions recipients_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ translations after you changed something run:
flutter gen-l10n
```

To use a translated string in the code use:
`AppLocalizations.of(context).helloWorld` and import:
To use a translated string in the code use: `context.l10n.helloWorld`
and import:
`import 'package:flutter_gen/gen_l10n/app_localizations.dart';`

### Upgrade flutter version
Expand Down Expand Up @@ -177,9 +177,10 @@ https://docs.codemagic.io/codemagic-yaml-cheatsheet.html

See [How to test](./docu/app_testing_guides/how_to_test.md)

### Run golden tests
### Golden tests

Run `flutter test --update-golden` to update golden files.
- Run `flutter test` to run all tests incl. all golden tests.
- Run `flutter test --update-goldens` to update golden files.

## Releasing

Expand Down
2 changes: 1 addition & 1 deletion recipients_app/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.4.0'
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.7.0'

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
Expand Down
140 changes: 70 additions & 70 deletions recipients_app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,98 @@ PODS:
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- cloud_firestore (5.6.0):
- Firebase/Firestore (= 11.4.0)
- cloud_firestore (5.6.3):
- Firebase/Firestore (= 11.7.0)
- firebase_core
- Flutter
- Firebase/Auth (11.4.0):
- Firebase/Auth (11.7.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 11.4.0)
- Firebase/CoreOnly (11.4.0):
- FirebaseCore (= 11.4.0)
- Firebase/Firestore (11.4.0):
- FirebaseAuth (~> 11.7.0)
- Firebase/CoreOnly (11.7.0):
- FirebaseCore (~> 11.7.0)
- Firebase/Firestore (11.7.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 11.4.0)
- Firebase/Messaging (11.4.0):
- FirebaseFirestore (~> 11.7.0)
- Firebase/Messaging (11.7.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 11.4.0)
- firebase_app_check (0.3.1-7):
- Firebase/CoreOnly (~> 11.4.0)
- FirebaseMessaging (~> 11.7.0)
- firebase_app_check (0.3.2-2):
- Firebase/CoreOnly (~> 11.7.0)
- firebase_core
- FirebaseAppCheck (~> 11.4.0)
- FirebaseAppCheck (~> 11.7.0)
- Flutter
- firebase_auth (5.3.4):
- Firebase/Auth (= 11.4.0)
- firebase_auth (5.4.2):
- Firebase/Auth (= 11.7.0)
- firebase_core
- Flutter
- firebase_core (3.9.0):
- Firebase/CoreOnly (= 11.4.0)
- firebase_core (3.11.0):
- Firebase/CoreOnly (= 11.7.0)
- Flutter
- firebase_messaging (15.1.6):
- Firebase/Messaging (= 11.4.0)
- firebase_messaging (15.2.2):
- Firebase/Messaging (= 11.7.0)
- firebase_core
- Flutter
- FirebaseAppCheck (11.4.0):
- FirebaseAppCheck (11.7.0):
- AppCheckCore (~> 11.0)
- FirebaseAppCheckInterop (~> 11.0)
- FirebaseCore (~> 11.0)
- FirebaseCore (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- FirebaseAppCheckInterop (11.6.0)
- FirebaseAuth (11.4.0):
- FirebaseAppCheckInterop (11.8.0)
- FirebaseAuth (11.7.0):
- FirebaseAppCheckInterop (~> 11.0)
- FirebaseAuthInterop (~> 11.0)
- FirebaseCore (~> 11.4)
- FirebaseCoreExtension (~> 11.4)
- FirebaseCore (~> 11.7.0)
- FirebaseCoreExtension (~> 11.7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/Environment (~> 8.0)
- GTMSessionFetcher/Core (< 5.0, >= 3.4)
- RecaptchaInterop (~> 100.0)
- FirebaseAuthInterop (11.6.0)
- FirebaseCore (11.4.0):
- FirebaseCoreInternal (~> 11.0)
- FirebaseAuthInterop (11.8.0)
- FirebaseCore (11.7.0):
- FirebaseCoreInternal (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Logger (~> 8.0)
- FirebaseCoreExtension (11.4.0):
- FirebaseCore (~> 11.0)
- FirebaseCoreInternal (11.6.0):
- FirebaseCoreExtension (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseCoreInternal (11.7.0):
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseFirestore (11.4.0):
- FirebaseFirestoreBinary (= 11.4.0)
- FirebaseFirestore (11.7.0):
- FirebaseFirestoreBinary (= 11.7.0)
- FirebaseFirestoreAbseilBinary (1.2024011602.0)
- FirebaseFirestoreBinary (11.4.0):
- FirebaseCore (= 11.4.0)
- FirebaseCoreExtension (= 11.4.0)
- FirebaseFirestoreInternalBinary (= 11.4.0)
- FirebaseSharedSwift (= 11.4.0)
- FirebaseFirestoreBinary (11.7.0):
- FirebaseCore (= 11.7.0)
- FirebaseCoreExtension (= 11.7.0)
- FirebaseFirestoreInternalBinary (= 11.7.0)
- FirebaseSharedSwift (= 11.7.0)
- FirebaseFirestoreGRPCBoringSSLBinary (1.65.1)
- FirebaseFirestoreGRPCCoreBinary (1.65.1):
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
- FirebaseFirestoreGRPCBoringSSLBinary (= 1.65.1)
- FirebaseFirestoreGRPCCPPBinary (1.65.1):
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
- FirebaseFirestoreGRPCCoreBinary (= 1.65.1)
- FirebaseFirestoreInternalBinary (11.4.0):
- FirebaseCore (= 11.4.0)
- FirebaseFirestoreInternalBinary (11.7.0):
- FirebaseCore (= 11.7.0)
- FirebaseFirestoreAbseilBinary (= 1.2024011602.0)
- FirebaseFirestoreGRPCCPPBinary (= 1.65.1)
- leveldb-library (~> 1.22)
- nanopb (~> 3.30910.0)
- FirebaseInstallations (11.4.0):
- FirebaseCore (~> 11.0)
- FirebaseInstallations (11.7.0):
- FirebaseCore (~> 11.7.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- FirebaseMessaging (11.4.0):
- FirebaseCore (~> 11.0)
- FirebaseMessaging (11.7.0):
- FirebaseCore (~> 11.7.0)
- FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Reachability (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (~> 3.30910.0)
- FirebaseSharedSwift (11.4.0)
- FirebaseSharedSwift (11.7.0)
- Flutter (1.0.0)
- flutter_native_splash (2.4.3):
- Flutter
Expand Down Expand Up @@ -125,7 +125,7 @@ PODS:
- GoogleUtilities/UserDefaults (8.0.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMSessionFetcher/Core (4.1.0)
- GTMSessionFetcher/Core (4.3.0)
- leveldb-library (1.22.6)
- nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0)
Expand Down Expand Up @@ -153,7 +153,7 @@ DEPENDENCIES:
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.4.0`)
- FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.7.0`)
- Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
Expand Down Expand Up @@ -203,7 +203,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_messaging/ios"
FirebaseFirestore:
:git: https://github.com/invertase/firestore-ios-sdk-frameworks.git
:tag: 11.4.0
:tag: 11.7.0
Flutter:
:path: Flutter
flutter_native_splash:
Expand All @@ -220,38 +220,38 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
FirebaseFirestore:
:git: https://github.com/invertase/firestore-ios-sdk-frameworks.git
:tag: 11.4.0
:tag: 11.7.0

SPEC CHECKSUMS:
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
cloud_firestore: 50c9e447367f07951ec36e06dffbce8e38bc2149
Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
firebase_app_check: 106382d86713329d844a412d44eccfc1779ee8d1
firebase_auth: dee97e7428ef7c304083839d4e3bc4313c03afd5
firebase_core: 726c34112998e66d1ddaf4b1bef78ed2dd4b9804
firebase_messaging: a538130cb2bca3ea0ff0892b8c948bd7d20ecaed
FirebaseAppCheck: 933cbda29279ed316b82360bca77602ac1af1ff2
FirebaseAppCheckInterop: 347aa09a805219a31249b58fc956888e9fcb314b
FirebaseAuth: c359af98bd703cbf4293eec107a40de08ede6ce6
FirebaseAuthInterop: a919d415797d23b7bfe195a04f322b86c65020ef
FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
FirebaseCoreExtension: 4445e4cd877e0790c4af33bedca61eaef27b7513
FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2
FirebaseFirestore: 97f18b411aaca686a9e94ba742341228643b1a46
cloud_firestore: 176d7a2e629c6473b1f99c413e27efe08715e7af
Firebase: a64bf6a8546e6eab54f1c715cd6151f39d2329f4
firebase_app_check: 0fe3abd6014c23d8cb1c865f7e9d34d5e44ca983
firebase_auth: a1aa0a20e8de111be5b9a5a2ba73201877f9f53d
firebase_core: 3d36094af9b47c46bfb965943413a39eebaca4db
firebase_messaging: 5881ea6744fe41f0759bc52844c530d64f3c37e3
FirebaseAppCheck: 2bd832b48faa38f7d86f902c57f78af93eae4cdc
FirebaseAppCheckInterop: 7bf86d55a2b7e9bd91464120eba3e52e4b63b2e2
FirebaseAuth: 77e25aa24f3e1c626c5babd3338551fc1669ee0e
FirebaseAuthInterop: 651756e70d9a0b9160db39ead71fd5507dbb6c84
FirebaseCore: 3227e35f4197a924206fbcdc0349325baf4f5de4
FirebaseCoreExtension: 206c1b399f0d103055207c16f299b28e3dbd1949
FirebaseCoreInternal: d6c17dafc8dc33614733a8b52df78fcb4394c881
FirebaseFirestore: 61305c5ac196ec1526dde68ac132543a7749a081
FirebaseFirestoreAbseilBinary: fa2ebd2ed02cadef5382e4f7c93f1b265c812c85
FirebaseFirestoreBinary: d0380b879b58d663b22467017d0e348d5b17b36b
FirebaseFirestoreBinary: 86eaad2ff00b789242734496029a3d08d4d86a89
FirebaseFirestoreGRPCBoringSSLBinary: d86ebbe2adc8d15d7ebf305fff7d6358385327f8
FirebaseFirestoreGRPCCoreBinary: 472bd808e1886a5efb2fd03dd09b98d34641a335
FirebaseFirestoreGRPCCPPBinary: db76d83d2b7517623f8426ed7f7a17bad2478084
FirebaseFirestoreInternalBinary: 01c33a6d789b95dce32dbdfcaf30d60ddf8902d8
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2
FirebaseSharedSwift: 505dae2d05969dbf6d43749a642bb1bf230f0252
FirebaseFirestoreInternalBinary: 1850c8c72f3d7933a00a4d0bae88021df87c9e10
FirebaseInstallations: 9347e719c3d52d8d7b9074b2c32407dd027305e9
FirebaseMessaging: 00ece041b71ddb52a2862ffdee73fb6e9824bd0c
FirebaseSharedSwift: a45efd84d60ebbfdcdbaebc66948af3630459e62
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_native_splash: 576fbd69b830a63594ae678396fa17e43abbc5f8
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMSessionFetcher: 923b710231ad3d6f3f0495ac1ced35421e07d9a6
GTMSessionFetcher: 257ead9ba8e15a2d389d79496e02b9cc5dd0c62c
leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
Expand All @@ -262,6 +262,6 @@ SPEC CHECKSUMS:
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
webview_flutter_wkwebview: 44d4dee7d7056d5ad185d25b38404436d56c547c

PODFILE CHECKSUM: 9a0f6acd578ce2f2c9bd914d243f7f5d4c09eda4
PODFILE CHECKSUM: 071e7eec1de34b6d35023216246825eb65a204cb

COCOAPODS: 1.16.2
3 changes: 2 additions & 1 deletion recipients_app/l10n.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
arb-dir: lib/l10n
arb-dir: lib/l10n/arb
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
untranslated-messages-file: untranslated_messages.txt
nullable-getter: false
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "package:cloud_firestore/cloud_firestore.dart";
// We are using DocumentReference in repository / data source. That's why we need to get
// no-op implementation for it for demo data source.

// NoOpDocumentReference is a no-op implementation of DocumentReference.
// ignore: subtype_of_sealed_class
class NoOpDocumentReference implements DocumentReference<Map<String, dynamic>> {
const NoOpDocumentReference();
Expand Down
86 changes: 78 additions & 8 deletions recipients_app/lib/data/models/payment/payment_ui_status.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,80 @@
import "package:app/ui/configs/app_colors.dart";
import "package:flutter/material.dart";

enum PaymentUiStatus {
confirmed,
contested,
toReview,
recentToReview,
onHoldContested,
onHoldToReview,
toBePaid,
empty,
/// blue label, white font, confirm icon
confirmed(
color: AppColors.primaryColor,
icon: Icons.check_rounded,
textColor: Colors.white,
iconColor: Colors.white,
),

/// yellow label, dark font, warning icon
contested(
color: AppColors.yellowColor,
icon: Icons.priority_high_rounded,
textColor: AppColors.fontColorDark,
iconColor: AppColors.fontColorDark,
),

/// yellow label, dark font, warning icon
toReview(
color: AppColors.yellowColor,
icon: Icons.priority_high_rounded,
textColor: AppColors.fontColorDark,
iconColor: AppColors.fontColorDark,
),

/// blue label, white font, question mark icon
recentToReview(
color: AppColors.primaryColor,
icon: Icons.question_mark_rounded,
textColor: Colors.white,
iconColor: Colors.white,
),

/// red label, dark font, close icon
onHoldContested(
color: AppColors.redColor,
icon: Icons.close_rounded,
textColor: AppColors.fontColorDark,
iconColor: AppColors.fontColorDark,
),

/// red label, dark font, close icon
onHoldToReview(
color: AppColors.redColor,
icon: Icons.close_rounded,
textColor: AppColors.fontColorDark,
iconColor: AppColors.fontColorDark,
),

/// backgroundColor label, dark font, no visbible icon (That's why iconColor is same as color)
toBePaid(
color: AppColors.backgroundColor,
icon: Icons.timer_outlined,
textColor: AppColors.fontColorDark,
iconColor: AppColors.backgroundColor,
),

/// backgroundColor label, dark font, no visbible icon (That's why iconColor is same as color)
empty(
color: AppColors.backgroundColor,
icon: Icons.question_mark_rounded,
textColor: AppColors.fontColorDark,
iconColor: AppColors.backgroundColor,
);

final Color color;
final IconData icon;
final Color textColor;
final Color iconColor;

const PaymentUiStatus({
required this.color,
required this.icon,
required this.textColor,
required this.iconColor,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "dart:developer";
import "package:sentry_flutter/sentry_flutter.dart";

class CrashReportingRepository {
CrashReportingRepository();
const CrashReportingRepository();

Future<void> logError(Exception exception, StackTrace stackTrace) async {
log("--- SENTRY: Logging error: $exception");
Expand All @@ -12,7 +12,6 @@ class CrashReportingRepository {

Future<void> logInfo(String message) async {
log("--- SENTRY: Logging info: $message");

Sentry.captureMessage(message);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// "unreachable_from_main" is ignored beacuse of the vm:entry-point function "_firebaseMessagingBackgroundHandler"
// ignore_for_file: unreachable_from_main
import "dart:developer";
import "package:firebase_messaging/firebase_messaging.dart";
Expand Down
Loading
Loading