From 257e726f79b7f7ae1851c5f45943cd58a5a570a7 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 2 Feb 2024 18:31:25 +0400 Subject: [PATCH 01/57] Update dependencies --- ios/Podfile | 2 +- ios/Podfile.lock | 146 +++++++-------- pubspec.lock | 472 ++++++++++++++++++++++++++++------------------- pubspec.yaml | 24 +-- 4 files changed, 367 insertions(+), 277 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index 313ea4a1..2c068c40 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '11.0' +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 97b809ff..b60d712a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,31 +1,31 @@ PODS: - - Firebase/CoreOnly (10.3.0): - - FirebaseCore (= 10.3.0) - - Firebase/Messaging (10.3.0): + - Firebase/CoreOnly (10.20.0): + - FirebaseCore (= 10.20.0) + - Firebase/Messaging (10.20.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 10.3.0) - - firebase_core (2.5.0): - - Firebase/CoreOnly (= 10.3.0) + - FirebaseMessaging (~> 10.20.0) + - firebase_core (2.25.0): + - Firebase/CoreOnly (= 10.20.0) - Flutter - - firebase_messaging (14.2.2): - - Firebase/Messaging (= 10.3.0) + - firebase_messaging (14.7.11): + - Firebase/Messaging (= 10.20.0) - firebase_core - Flutter - - FirebaseCore (10.3.0): + - FirebaseCore (10.20.0): - FirebaseCoreInternal (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreInternal (10.5.0): + - GoogleUtilities/Environment (~> 7.12) + - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreInternal (10.20.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseInstallations (10.5.0): + - FirebaseInstallations (10.20.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.3.0): + - FirebaseMessaging (10.20.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - - GoogleDataTransport (~> 9.2) + - GoogleDataTransport (~> 9.3) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Reachability (~> 7.8) @@ -34,15 +34,15 @@ PODS: - Flutter (1.0.0) - flutter_secure_storage (6.0.0): - Flutter - - GoogleDataTransport (9.2.1): + - GoogleDataTransport (9.3.0): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - - GoogleMLKit/BarcodeScanning (3.2.0): + - GoogleMLKit/BarcodeScanning (4.0.0): - GoogleMLKit/MLKitCore - - MLKitBarcodeScanning (~> 2.2.0) - - GoogleMLKit/MLKitCore (3.2.0): - - MLKitCommon (~> 8.0.0) + - MLKitBarcodeScanning (~> 3.0.0) + - GoogleMLKit/MLKitCore (4.0.0): + - MLKitCommon (~> 9.0.0) - GoogleToolboxForMac/DebugUtils (2.3.2): - GoogleToolboxForMac/Defines (= 2.3.2) - GoogleToolboxForMac/Defines (2.3.2) @@ -55,56 +55,56 @@ PODS: - GoogleToolboxForMac/Defines (= 2.3.2) - "GoogleToolboxForMac/NSString+URLArguments (= 2.3.2)" - "GoogleToolboxForMac/NSString+URLArguments (2.3.2)" - - GoogleUtilities/AppDelegateSwizzler (7.11.0): + - GoogleUtilities/AppDelegateSwizzler (7.12.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (7.11.0): + - GoogleUtilities/Environment (7.12.0): - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.11.0): + - GoogleUtilities/Logger (7.12.0): - GoogleUtilities/Environment - - GoogleUtilities/Network (7.11.0): + - GoogleUtilities/Network (7.12.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.11.0)" - - GoogleUtilities/Reachability (7.11.0): + - "GoogleUtilities/NSData+zlib (7.12.0)" + - GoogleUtilities/Reachability (7.12.0): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (7.11.0): + - GoogleUtilities/UserDefaults (7.12.0): - GoogleUtilities/Logger - GoogleUtilitiesComponents (1.1.0): - GoogleUtilities/Logger - - GTMSessionFetcher/Core (1.7.2) - - MLImage (1.0.0-beta3) - - MLKitBarcodeScanning (2.2.0): - - MLKitCommon (~> 8.0) - - MLKitVision (~> 4.2) - - MLKitCommon (8.0.0): + - GTMSessionFetcher/Core (2.3.0) + - MLImage (1.0.0-beta4) + - MLKitBarcodeScanning (3.0.0): + - MLKitCommon (~> 9.0) + - MLKitVision (~> 5.0) + - MLKitCommon (9.0.0): - GoogleDataTransport (~> 9.0) - GoogleToolboxForMac/Logger (~> 2.1) - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)" - GoogleUtilities/UserDefaults (~> 7.0) - GoogleUtilitiesComponents (~> 1.0) - - GTMSessionFetcher/Core (~> 1.1) - - Protobuf (~> 3.12) - - MLKitVision (4.2.0): + - GTMSessionFetcher/Core (< 3.0, >= 1.1) + - MLKitVision (5.0.0): - GoogleToolboxForMac/Logger (~> 2.1) - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" - - GTMSessionFetcher/Core (~> 1.1) - - MLImage (= 1.0.0-beta3) - - MLKitCommon (~> 8.0) - - Protobuf (~> 3.12) - - mobile_scanner (3.0.0): + - GTMSessionFetcher/Core (< 3.0, >= 1.1) + - MLImage (= 1.0.0-beta4) + - MLKitCommon (~> 9.0) + - mobile_scanner (3.5.6): + - Flutter + - GoogleMLKit/BarcodeScanning (~> 4.0.0) + - nanopb (2.30909.1): + - nanopb/decode (= 2.30909.1) + - nanopb/encode (= 2.30909.1) + - nanopb/decode (2.30909.1) + - nanopb/encode (2.30909.1) + - path_provider_foundation (0.0.1): - Flutter - - GoogleMLKit/BarcodeScanning (~> 3.2.0) - - nanopb (2.30909.0): - - nanopb/decode (= 2.30909.0) - - nanopb/encode (= 2.30909.0) - - nanopb/decode (2.30909.0) - - nanopb/encode (2.30909.0) - - PromisesObjC (2.2.0) - - Protobuf (3.22.0) + - FlutterMacOS + - PromisesObjC (2.3.1) - share (0.0.1): - Flutter - url_launcher_ios (0.0.1): @@ -116,6 +116,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - share (from `.symlinks/plugins/share/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) @@ -138,7 +139,6 @@ SPEC REPOS: - MLKitVision - nanopb - PromisesObjC - - Protobuf EXTERNAL SOURCES: firebase_core: @@ -151,38 +151,40 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_secure_storage/ios" mobile_scanner: :path: ".symlinks/plugins/mobile_scanner/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" share: :path: ".symlinks/plugins/share/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: - Firebase: f92fc551ead69c94168d36c2b26188263860acd9 - firebase_core: f95c8bbe65213d406d592573ad42a12d64849cb8 - firebase_messaging: 3daef9f9ee5b91de2f282895ec91cc5e5ca78556 - FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a - FirebaseCoreInternal: e463f41bb935cd049505bf7e9a5bdd7dcea90df6 - FirebaseInstallations: 935bc4abb6f7a035cab7a0c31cb777b2be3dd254 - FirebaseMessaging: e345b219fd15d325f0cf2fef28cb8ce00d851b3f + Firebase: 10c8cb12fb7ad2ae0c09ffc86cd9c1ab392a0031 + firebase_core: 86455a528b3b0961c5f1324fa938bcfcd30cd7ac + firebase_messaging: 30d33503ee8447af738c4778e7a3a9764096c2a6 + FirebaseCore: 28045c1560a2600d284b9c45a904fe322dc890b6 + FirebaseCoreInternal: efeeb171ac02d623bdaefe121539939821e10811 + FirebaseInstallations: 558b1da7d65afeb996fd5c814332f013234ece4e + FirebaseMessaging: 06c414a21b122396a26847c523d5c370f8325df5 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be - GoogleDataTransport: ea169759df570f4e37bdee1623ec32a7e64e67c4 - GoogleMLKit: 0017a6a8372e1a182139b9def4d89be5d87ca5a7 + GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe + GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34 - GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f + GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe - GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba - MLImage: 489dfec109f21da8621b28d476401aaf7a0d4ff4 - MLKitBarcodeScanning: d92fe1911001ec36870162c5a0eb206f612b7169 - MLKitCommon: f6da6c5659618c070b50a80db01248ebe2964175 - MLKitVision: 96c96571190b7f63eddf4a12068ce8a8689e0d2c - mobile_scanner: 004f7ad2fe4e2b5a3e6ed0bc4b83ca9c5b5dd975 - nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 - PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef - Protobuf: 5e6cbc143d02fe08585d86b0098f8b755d2caaab + GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2 + MLImage: 7bb7c4264164ade9bf64f679b40fb29c8f33ee9b + MLKitBarcodeScanning: 04e264482c5f3810cb89ebc134ef6b61e67db505 + MLKitCommon: c1b791c3e667091918d91bda4bba69a91011e390 + MLKitVision: 8baa5f46ee3352614169b85250574fde38c36f49 + mobile_scanner: 38dcd8a49d7d485f632b7de65e4900010187aef2 + nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 share: 0b2c3e82132f5888bccca3351c504d0003b3b410 - url_launcher_ios: fb12c43172927bb5cf75aeebd073f883801f1993 + url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 -PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d +PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 -COCOAPODS: 1.11.3 +COCOAPODS: 1.14.3 diff --git a/pubspec.lock b/pubspec.lock index 153b7375..88b23920 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,66 +5,66 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: d93b0378aadce9c1388108067946276582c2ae89426c64c17920c74988508fed + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "22.0.0" + version: "64.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "6215ac7d00ed98300b72f45ed2b38c2ca841f9f4e6965fab33cbd591e45e4473" + sha256: "96592ccc798cbc704d7b1db9e0595121831c4bef1b6fe952d6b55cac07f7b3b7" url: "https://pub.dev" source: hosted - version: "1.0.13" + version: "1.3.17" analyzer: dependency: transitive description: name: analyzer - sha256: "581a0281129283e75d4d67d6ac6e391c0515cdce37eb6eb4bc8a52e65d2b16b6" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "6.2.0" archive: dependency: transitive description: name: archive - sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" url: "https://pub.dev" source: hosted - version: "3.3.6" + version: "3.4.10" args: dependency: transitive description: name: args - sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.2" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" basic_utils: dependency: "direct main" description: name: basic_utils - sha256: eb424482531df5d5576da64f039fe49f12c9ab979d9a64a0f4385da8a6e2751d + sha256: "2064b21d3c41ed7654bc82cc476fd65542e04d60059b74d5eed490a4da08fc6c" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.7.0" bazel_worker: dependency: transitive description: name: bazel_worker - sha256: "500584fdb80bcb70a2990a5838338a757cc24bbf27d88bf791cbe9461c57cd5a" + sha256: "6f306845d941808bed2fdbd7db3a39de273a8248a9303cfebf0cfa861372616e" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" boolean_selector: dependency: transitive description: @@ -77,66 +77,66 @@ packages: dependency: transitive description: name: build - sha256: de3ecca84980ee5e632888a04f4a72d8e3c390104fd5edb3a724785f66e9e97a + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - sha256: "9160104f468c8117f7dddd3c94d8f440d0f82a324bf29eb84e0b434cff7a0e03" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 url: "https://pub.dev" source: hosted - version: "0.4.7" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "02d9e94f2b7f6e4de0f0cd24dc9e2cd0c00fec082265ca89d3b32282cb7381bc" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "4.0.1" build_modules: dependency: transitive description: name: build_modules - sha256: d1f07625cb59fc0b19fcc6958f0e4c7b17afcc924245f7983f9d9e665784543e + sha256: "66f0f746a239ff6cceba9d235a679ec70a6d9037ddddb36a24a0791a639a8486" url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "5.0.7" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: a171129ff393d360a5ec9ba3a2277e0d7e713027709f08196e8192688b537074 + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.4.2" build_runner: dependency: "direct main" description: name: build_runner - sha256: cd95f4d4a6a13b0dc1408b0a4b086bffdac08dcb61e45a0e1f2f58905d4c97a5 + sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" url: "https://pub.dev" source: hosted - version: "1.12.2" + version: "2.4.8" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "653b9dfd0472476ca837ef62786717434b8fa4f5e5521c85d7376dd3234aefeb" + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" url: "https://pub.dev" source: hosted - version: "6.1.12" + version: "7.3.0" build_web_compilers: dependency: "direct main" description: name: build_web_compilers - sha256: "1026cd00acb06e2bd27e3338c99fe18cd5b3caa0d79d2ee5b7edbe1dadb72644" + sha256: aad1d705faa53d060e7ccb7855ee74705a8e3d9ea1634e63e362cc2c1bd47afa url: "https://pub.dev" source: hosted - version: "2.16.5" + version: "4.0.9" built_collection: dependency: transitive description: @@ -149,18 +149,18 @@ packages: dependency: transitive description: name: built_value - sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0" + sha256: a3ec2e0f967bc47f69f95009bb93db936288d61d5343b9436e378b28a2f830c6 url: "https://pub.dev" source: hosted - version: "8.4.4" + version: "8.9.0" characters: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" charcode: dependency: transitive description: @@ -173,18 +173,18 @@ packages: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" cli_util: dependency: transitive description: name: cli_util - sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 url: "https://pub.dev" source: hosted - version: "0.3.5" + version: "0.4.1" clock: dependency: transitive description: @@ -197,18 +197,18 @@ packages: dependency: transitive description: name: code_builder - sha256: "48ae73ba8dbf1923de91e0fd65736148f63f6c6fb0925bdda05c1df0298c55e1" + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 url: "https://pub.dev" source: hosted - version: "3.7.0" + version: "4.10.0" collection: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" confetti: dependency: "direct main" description: @@ -229,34 +229,34 @@ packages: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" csslib: dependency: transitive description: name: csslib - sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" url: "https://pub.dev" source: hosted - version: "0.17.2" + version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" dart_style: dependency: transitive description: name: dart_style - sha256: "7f5b48e6a448c4b46250a6113857a00eaa82821ef5a3d7f42e68eb69d1283fa3" + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.4" email_validator: dependency: "direct main" description: @@ -281,62 +281,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" firebase_core: dependency: transitive description: name: firebase_core - sha256: be13e431c0c950f0fc66bdb67b41b8059121d7e7d8bbbc21fb59164892d561f8 + sha256: b6e8e290dcc05739a573591fe71a21af2b50e199242e7460fac36acc4587c623 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.25.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: "5615b30c36f55b2777d0533771deda7e5730e769e5d3cb7fda79e9bed86cfa55" + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.5.3" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "4b3a41410f3313bb95fd560aa5eb761b6ad65c185de772c72231e8b4aeed6d18" + sha256: "5fcd979e8e6ba90089f0bc75b4ad9f6f939120c3eb63018987ef2a551380a0ac" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.11.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: dbccddc62fef6f3745ba83062bfd1fbf2eb6a931db4c73d03f85c5772dfdec7f + sha256: "4edd4ea0c314566891877b1e422463937517f4dbbf1ebcf2952b9f7f85388e8a" url: "https://pub.dev" source: hosted - version: "14.2.2" + version: "14.7.11" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "564a47ea76db9cd2d17e7d95790428ad3de9d0075795d14c4c901ba0bf518e1a" + sha256: "0917263f599034a12e3c4a1055f3e17f34d784d77a07f22e34f300214cd1b51f" url: "https://pub.dev" source: hosted - version: "4.2.11" + version: "4.5.19" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "76291494583a003d4ce0d613c41cb87c58fab25773317daa66a245f537e1c3f7" + sha256: dc9a23cbc4351ca8c8fc6532c56198713d02a10253aeb15af769ab9a4840f83a url: "https://pub.dev" source: hosted - version: "3.2.12" + version: "3.6.0" fixnum: dependency: transitive description: @@ -349,10 +357,10 @@ packages: dependency: "direct main" description: name: fluro - sha256: "66d82964a1b6967def34155de92f7bb87ee247aba53ea5dbb70e2bf206865dbc" + sha256: "24d07d0b285b213ec2045b83e85d076185fa5c23651e44dae0ac6755784b97d0" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.0.5" flutter: dependency: "direct main" description: flutter @@ -362,66 +370,66 @@ packages: dependency: "direct dev" description: name: flutter_launcher_icons - sha256: ce0e501cfc258907842238e4ca605e74b7fd1cdf04b3b43e86c43f3e40a1592c + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" url: "https://pub.dev" source: hosted - version: "0.11.0" + version: "0.13.1" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - sha256: f2afec1f1762c040a349ea2a588e32f442da5d0db3494a52a929a97c9e550bc5 + sha256: ffdbb60130e4665d2af814a0267c481bcf522c41ae2e43caf69fa0146876d685 url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "9.0.0" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "0912ae29a572230ad52d8a4697e5518d7f0f429052fd51df7e5a7952c7efe2a3" + sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.2.0" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: ff0768a6700ea1d9620e03518e2e25eac86a8bd07ca3556e9617bfa5ace4bd00 + sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: b3773190e385a3c8a382007893d678ae95462b3c2279e987b55d140d3b0cb81b + sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: "42938e70d4b872e856e678c423cc0e9065d7d294f45bc41fc1981a4eb4beaffe" + sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: ca89c8059cf439985aa83c59619b3674c7ef6cc2e86943d169a7369d6a69cab5 + sha256: "5809c66f9dd3b4b93b0a6e2e8561539405322ee767ac2f64d084e2ab5429d108" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "3.0.0" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - sha256: "77a2117c0517ff909221f3160b8eb20052ab5216107581168af574ac1f05dff8" + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.2.0" flutter_test: dependency: "direct dev" description: flutter @@ -432,46 +440,54 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" glob: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - sha256: e84da18c5bd9854f4222e62d762e0ffd290726ffc5785dcb976f8c16ff797f5e + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.3.1" html: dependency: transitive description: name: html - sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" url: "https://pub.dev" source: hosted - version: "0.15.1" + version: "0.15.4" http: dependency: "direct main" description: name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.2.0" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: "90daef58b775dc37bc409f4053763503f6544f6af7c910d2c2a7f1946554e5e5" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "3.2.1" http_parser: dependency: transitive description: @@ -484,90 +500,90 @@ packages: dependency: transitive description: name: image - sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "4.1.4" intl: dependency: "direct main" description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.19.0" io: dependency: transitive description: name: io - sha256: "69955598ee18b1044fc2e5199a146ea871f59561d5fdda5bdf4cc80644d81a04" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" url: "https://pub.dev" source: hosted - version: "0.3.4" + version: "1.0.4" js: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: transitive description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.10.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" mobile_scanner: dependency: "direct main" description: name: mobile_scanner - sha256: "441ac8d39742c221b19519ed6469909687619405c593004b6332c97d908f838a" + sha256: "619ed5fd43ca9007a151f00c3dc43feedeaf235fe5647735d0237c38849d49dc" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" package_config: dependency: transitive description: @@ -580,42 +596,90 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" - pedantic: + version: "1.8.3" + path_provider: dependency: transitive description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + name: path_provider + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "2.1.2" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" petitparser: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.8" pointycastle: dependency: transitive description: name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" url: "https://pub.dev" source: hosted - version: "3.6.2" + version: "3.7.4" pool: dependency: transitive description: @@ -628,42 +692,42 @@ packages: dependency: transitive description: name: protobuf - sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08" + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.1.0" pub_semver: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.3" qr: dependency: transitive description: name: qr - sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.1" qr_flutter: dependency: "direct main" description: name: qr_flutter - sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.1.0" rect_getter: dependency: "direct main" description: @@ -676,10 +740,10 @@ packages: dependency: transitive description: name: scratch_space - sha256: a469a9642a4d7ee406d6224a85446eb8baa9dd6d81e2f0b76770deae7bd32aab + sha256: "8510fbff458d733a58fc427057d1ac86303b376d609d6e1bc43f240aad9aa445" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" share: dependency: "direct main" description: @@ -692,18 +756,18 @@ packages: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -713,50 +777,50 @@ packages: dependency: "direct main" description: name: socket_io_client - sha256: a9c589d3fe2658506be38ddb36f23348daab73a00ff1645533669d07a5111cfc + sha256: ede469f3e4c55e8528b4e023bdedbc20832e8811ab9b61679d1ba3ed5f01f23b url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3+1" socket_io_common: dependency: transitive description: name: socket_io_common - sha256: "5a218a784df4d1927ae713e17af619caa736cb2ebac287c59e4e24228b22da29" + sha256: "2ab92f8ff3ebbd4b353bf4a98bee45cc157e3255464b2f90f66e09c4472047eb" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" source_maps: dependency: transitive description: name: source_maps - sha256: "651a090e98727d604285b7b5019fd083aa62200a5cc66a02aca04e42420a8b4c" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" url: "https://pub.dev" source: hosted - version: "0.10.9" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -785,18 +849,18 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.1" timeago: dependency: "direct main" description: name: timeago - sha256: "3a38963615f1178531afa7177199e37522cf8dcbd93a144b597e32ec6d84bd9f" + sha256: d3204eb4c788214883380253da7f23485320a58c11d145babc82ad16bf4e7764 url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.6.1" timing: dependency: transitive description: @@ -809,90 +873,90 @@ packages: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" universal_html: dependency: "direct main" description: name: universal_html - sha256: "5ff50b7c14d201421cf5230ec389a0591c4deb5c817c9d7ccca3b26fe5f31e34" + sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971" url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.2.4" universal_io: dependency: transitive description: name: universal_io - sha256: "79f78ddad839ee3aae3ec7c01eb4575faf0d5c860f8e5223bc9f9c17f7f03cef" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.2" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: e8f2efc804810c0f2f5b485f49e7942179f56eabcfe81dce3387fec4bb55876b + sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c url: "https://pub.dev" source: hosted - version: "6.1.9" + version: "6.2.4" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" url: "https://pub.dev" source: hosted - version: "6.0.23" + version: "6.2.2" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "0a5af0aefdd8cf820dd739886efb1637f1f24489900204f50984634c07a54815" + sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.2.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.1" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.2.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.1.1" vector_math: dependency: transitive description: @@ -905,34 +969,58 @@ packages: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + url: "https://pub.dev" + source: hosted + version: "5.2.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" xml: dependency: transitive description: name: xml - sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.5.0" yaml: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=2.19.0 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.2.0 <3.5.0" + flutter: ">=3.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index 592a33f0..ca233789 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,27 +18,27 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 2.3.1+18 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: - flutter_secure_storage: ^7.0.1 - build_web_compilers: '^2.11.0' - firebase_messaging: ^14.2.1 + flutter_secure_storage: ^9.0.0 + build_web_compilers: '^4.0.9' + firebase_messaging: ^14.7.11 socket_io_client: ^2.0.1 email_validator: ^2.1.17 flutter_spinkit: ^5.1.0 - build_runner: '^1.10.0' - url_launcher: ^6.1.9 - basic_utils: ^5.4.2 + build_runner: '^2.4.8' + url_launcher: ^6.2.4 + basic_utils: ^5.7.0 rect_getter: ^1.1.0 - qr_flutter: ^4.0.0 + qr_flutter: ^4.1.0 event_bus: ^2.0.0 confetti: ^0.7.0 timeago: ^3.2.2 share: ^2.0.4 fluro: ^2.0.4 - http: ^0.13.5 - intl: ^0.18.0 + http: ^1.2.0 + intl: ^0.19.0 flutter: sdk: flutter @@ -48,12 +48,12 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.5 universal_html: ^2.0.8 - mobile_scanner: ^3.1.0 + mobile_scanner: ^4.0.0 dev_dependencies: flutter_test: sdk: flutter - flutter_launcher_icons: ^0.11.0 + flutter_launcher_icons: ^0.13.1 flutter_icons: android: "launcher_icon" From 0f211bb8039d61777659c950784fadf2dd6b4e1f Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 2 Feb 2024 18:31:56 +0400 Subject: [PATCH 02/57] Upgrade code for nullability-first --- lib/app_controller.dart | 21 +++-- lib/authentication.dart | 9 +-- lib/client.dart | 22 ++++-- lib/main.dart | 10 ++- lib/models/account.dart | 12 +-- lib/models/address.dart | 10 +-- lib/models/invoice.dart | 62 +++++++-------- lib/models/merchant.dart | 6 +- lib/native_storage.dart | 2 +- lib/push_notifications.dart | 30 ++++--- lib/router.dart | 2 +- lib/routes/addresses.dart | 4 +- lib/routes/create_account.dart | 14 ++-- lib/routes/edit_business_info.dart | 15 ++-- lib/routes/forgot_password.dart | 16 ++-- lib/routes/invoice.dart | 122 +++++++++++++++-------------- lib/routes/login.dart | 24 ++++-- lib/routes/navigation.dart | 6 +- lib/routes/new_address.dart | 36 +++++---- lib/routes/new_invoice.dart | 28 +++---- lib/routes/payment.dart | 34 ++++---- lib/routes/payments.dart | 6 +- lib/routes/set_currency.dart | 8 +- lib/routes/settings.dart | 6 +- lib/web_storage.dart | 15 ---- 25 files changed, 266 insertions(+), 254 deletions(-) delete mode 100644 lib/web_storage.dart diff --git a/lib/app_controller.dart b/lib/app_controller.dart index 7139b42b..816d56ee 100644 --- a/lib/app_controller.dart +++ b/lib/app_controller.dart @@ -3,16 +3,15 @@ import 'package:flutter/material.dart'; import 'dart:async'; import 'dart:math'; -import 'package:app/native_storage.dart' - if (dart.library.html) 'package:app/web_storage.dart'; +import 'package:app/native_storage.dart'; class AppController extends StatefulWidget { - final Function(BuildContext) builder; + final Function(BuildContext)? builder; static final globalKey = new GlobalKey(); static bool enableDarkMode = false; static bool dialogIsOpen = false; - static String openedPath; + static String? openedPath; static String logoImagePath() { var modifier = enableDarkMode ? '-white' : ''; @@ -79,10 +78,10 @@ class AppController extends StatefulWidget { ].toList(); static BuildContext getCurrentContext() { - return globalKey.currentState.overlay.context; + return globalKey.currentState!.overlay!.context; } - static double scale(num value, {num maxValue, num minValue}) { + static double scale(num value, {num? maxValue, num? minValue}) { var screenData = MediaQuery.of(getCurrentContext()); value = value * screenData.size.height/650; value = min(value, maxValue ?? double.maxFinite); @@ -90,7 +89,7 @@ class AppController extends StatefulWidget { return value.toDouble(); } - static void openDialog(title, body, {path: null, buttonText: null, buttons: null}) async { + static void openDialog(title, body, {path, buttonText, buttons}) async { if (dialogIsOpen) return; dialogIsOpen = true; @@ -132,7 +131,7 @@ class AppController extends StatefulWidget { Navigator.pushNamedAndRemoveUntil(getCurrentContext(), path, (Route route) => false); } - static void openPath(String path) async { + static void openPath(String? path) async { if (path != null && openedPath != path) Navigator.pushNamed(getCurrentContext(), path); Timer(Duration(milliseconds: 5000), () => openedPath = null); @@ -140,13 +139,13 @@ class AppController extends StatefulWidget { } const AppController( - {Key key, this.builder}) + {Key? key, this.builder}) : super(key: key); @override AppControllerState createState() => new AppControllerState(); - static AppControllerState of(BuildContext context) { + static AppControllerState? of(BuildContext context) { return context.findAncestorStateOfType(); } } @@ -155,7 +154,7 @@ class AppControllerState extends State { @override Widget build(BuildContext context) { - return widget.builder(context); + return widget.builder!(context); } void rebuild() { diff --git a/lib/authentication.dart b/lib/authentication.dart index 6350b954..f5d0b453 100644 --- a/lib/authentication.dart +++ b/lib/authentication.dart @@ -7,12 +7,11 @@ import 'package:app/client.dart'; import 'package:app/coins.dart'; import 'dart:async'; -import 'package:app/native_storage.dart' - if (dart.library.html) 'package:app/web_storage.dart'; +import 'package:app/native_storage.dart'; class Authentication { static Account currentAccount = Account(); - static String token; + static String? token; static void setEmail(email) { if (currentAccount.email != email) @@ -115,7 +114,7 @@ class Authentication { }); } - static Future readFromDisk(key) async { + static Future readFromDisk(key) async { return Storage.read(key); } @@ -123,7 +122,7 @@ class Authentication { if (token == null) return await Storage.delete('token'); else - return await Storage.write('token', token); + return await Storage.write('token', token!); } static void saveAccountToDisk() async { diff --git a/lib/client.dart b/lib/client.dart index 8620f00a..e656ff36 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -8,16 +8,18 @@ import 'dart:io'; class Client { static final protocol = 'https'; - static final domain = 'api.anypayx.com'; + static final domain = 'anypay.pshenmic.dev'; static final host = "$protocol://$domain"; static String humanize(str) { - if (str != null && str.length > 0) + if (str.length > 0) return StringUtils.capitalize(str); + else + return ""; } static String buildAuthHeader() { - String token = Authentication.token; + String token = Authentication.token ?? ''; return 'Basic ' + base64.encode(utf8.encode('$token:')); } @@ -33,11 +35,15 @@ class Client { } static Future> fetchCoins() async { - return makeRequest('get', + var req = await makeRequest('get', unauthorized: (() => Authentication.logout()), requireAuth: true, path: '/coins', ); + + print(jsonEncode(req)); + + return req; } static Future> fetchAccountAddresses() async { @@ -213,22 +219,22 @@ class Client { var code = response.statusCode; // For debugging: // print("PATH: $path, BODY: ${jsonEncode(body ?? {})}, CODE: $code"); - if (response.statusCode == 401 && unauthorized != null) { + if (code == 401 && unauthorized != null) { unauthorized(); return { 'message': 'Unauthorized', 'success': false, 'body': { }, }; - } else if (genericErrorCodes.contains(response.statusCode)) { + } else if (genericErrorCodes.contains(code)) { return { 'success': false, 'message': "Something went wrong, please try again later", 'body': { }, }; } else return { - 'success': response.statusCode == 200, - 'message': humanize(message ?? ""), + 'success': code == 200, + 'message': humanize(message), 'body': responseBody, }; } on SocketException catch (_) { diff --git a/lib/main.dart b/lib/main.dart index ba3672fe..1516d1f4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,13 +27,15 @@ class Anypay extends StatelessWidget { primaryColorDark: Color(0xFF707070), primaryColorLight: Color(0xFF404040), brightness: Brightness.light, - accentColor: AppController.blue, + colorScheme: ColorScheme.fromSwatch() + .copyWith(secondary: AppController.blue), fontFamily: 'Ubuntu', ); var darkTheme = ThemeData( primaryColorDark: Color(0xffCCCCCC), primaryColorLight: Color(0xFFFFFFFF), - accentColor: Color(0xff2196f3), + colorScheme: ColorScheme.fromSwatch() + .copyWith(secondary: Color(0xff2196f3)), brightness: Brightness.dark, fontFamily: 'Ubuntu', ); @@ -47,9 +49,9 @@ class Anypay extends StatelessWidget { } return MaterialApp( - builder: (BuildContext context, Widget child) { + builder: (BuildContext context, Widget? child) { return SafeArea( - child: child, + child: child!, ); }, initialRoute: isAuthenticated ? '/new-invoice' : '/login', diff --git a/lib/models/account.dart b/lib/models/account.dart index 9324736d..6d95e607 100644 --- a/lib/models/account.dart +++ b/lib/models/account.dart @@ -5,11 +5,11 @@ import 'dart:convert'; class Account { Map addresses = {}; bool fetchingCoins = false; - String ambassadorEmail; - String physicalAddress; - String businessName; - String denomination; - String email; + String? ambassadorEmail; + String? physicalAddress; + String? businessName; + String? denomination; + String? email; List coins = []; @@ -29,7 +29,7 @@ class Account { return addresses[code]; } - String get preferredCoinCode { + String? get preferredCoinCode { if (coins.length == 0) return null; var codes = coins.map((a) => a['code']); if (codes.contains('BSV')) diff --git a/lib/models/address.dart b/lib/models/address.dart index b0c1d5c4..d15ba326 100644 --- a/lib/models/address.dart +++ b/lib/models/address.dart @@ -7,11 +7,11 @@ import 'dart:convert'; // import 'dart:io'; class Address { - int id; - String note; - String value; - String currency; - String paymail; + int? id; + String? note; + String? value; + String? currency; + String? paymail; Address({ this.id, diff --git a/lib/models/invoice.dart b/lib/models/invoice.dart index 84312017..d1376a1c 100644 --- a/lib/models/invoice.dart +++ b/lib/models/invoice.dart @@ -7,27 +7,27 @@ import 'dart:convert'; import 'dart:io'; class Invoice { - String denominationCurrency; - num denominationAmountPaid; - num denominationAmount; - DateTime completedAt; - String blockchainUrl; - List paymentOptions; - String redirectUrl; - String accountId; - String itemName; - String currency; - DateTime expiry; - String address; - bool complete; - String status; - String hash; - List notes; - num amount; - num invoiceAmount; - num invoiceAmountPaid; - String uri; - String uid; + String? denominationCurrency; + num? denominationAmountPaid; + num? denominationAmount; + DateTime? completedAt; + String? blockchainUrl; + List? paymentOptions; + String? redirectUrl; + String? accountId; + String? itemName; + String? currency; + DateTime? expiry; + String? address; + bool? complete; + String? status; + String? hash; + List? notes; + num? amount; + num? invoiceAmount; + num? invoiceAmountPaid; + String? uri; + String? uid; Invoice({ this.denominationAmountPaid, @@ -53,8 +53,8 @@ class Invoice { this.uid, }); - String getBlockchainUrl() { - if (blockchainUrl != null && blockchainUrl.length > 0) + String? getBlockchainUrl() { + if (blockchainUrl != null && blockchainUrl!.length > 0) return blockchainUrl; else if (currency == 'BSV') return "https://whatsonchain.com/tx/$hash"; @@ -69,13 +69,13 @@ class Invoice { } String orderNotes() { - if (notes != null && notes.length > 0) + if (notes != null && notes!.length > 0) return "Order notes: ${noteText()}"; else return ""; } int decimalPlaces() { - return (Currencies.all[denominationCurrency] ?? {})['decimal_places'] ?? 2; + return (Currencies.all[denominationCurrency] ?? {})['decimal_places'] as int ?? 2; } String paidAmountWithDenomination() { @@ -91,7 +91,7 @@ class Invoice { return NumberFormat.currency( decimalDigits: decimalPlaces(), locale: Platform.localeName, - symbol: symbol, + symbol: symbol as String, ).format(amount); } catch(e) { // Fallback in case there is an unsupported locale @@ -119,11 +119,11 @@ class Invoice { } bool isExpired() { - return expiry.isBefore(DateTime.now()); + return expiry != null && expiry!.isBefore(DateTime.now()); } Map get bsvPaymentOption { - return paymentOptions.firstWhere((option) => option['currency'] == 'BSV', orElse: () => null); + return paymentOptions?.firstWhere((option) => option['currency'] == 'BSV', orElse: () => null); } String urlStyleUri([useCurrency]) { @@ -147,19 +147,19 @@ class Invoice { } Map paymentOptionFor(currency) { - return paymentOptions.firstWhere((option) { + return paymentOptions?.firstWhere((option) { return option['currency'] == currency; }) ?? {}; } String completedAtTimeAgo() { if (completedAt == null) return ''; - return timeago.format(completedAt); + return timeago.format(completedAt!); } String formatCompletedAt() { if (completedAt == null) return ''; - else return DateFormat('E, MMMM d, h:mma').format(completedAt); + else return DateFormat('E, MMMM d, h:mma').format(completedAt!); } factory Invoice.fromMap(Map body) { diff --git a/lib/models/merchant.dart b/lib/models/merchant.dart index 46262a2c..24192607 100644 --- a/lib/models/merchant.dart +++ b/lib/models/merchant.dart @@ -3,9 +3,9 @@ import 'dart:convert'; class Merchant { Map addresses = {}; bool fetchingCoins = false; - String denomination; - int accountId; - String name; + String? denomination; + int? accountId; + String? name; Merchant({ this.name, diff --git a/lib/native_storage.dart b/lib/native_storage.dart index 227ae372..69274d24 100644 --- a/lib/native_storage.dart +++ b/lib/native_storage.dart @@ -1,7 +1,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; class Storage { - static Future read(String key) async { + static Future read(String key) async { final storage = FlutterSecureStorage(); return await storage.read(key: key); } diff --git a/lib/push_notifications.dart b/lib/push_notifications.dart index c92f8fdb..9471fd97 100644 --- a/lib/push_notifications.dart +++ b/lib/push_notifications.dart @@ -1,16 +1,10 @@ import 'package:socket_io_client/socket_io_client.dart' as IO; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/foundation.dart' show kIsWeb; import 'package:app/authentication.dart'; import 'package:app/models/invoice.dart'; import 'package:app/app_controller.dart'; -import 'package:flutter/material.dart'; import 'package:app/client.dart'; import 'package:app/events.dart'; -import 'dart:convert'; - -import 'package:url_launcher/url_launcher.dart' -if (dart.library.html) 'package:app/web_launcher.dart'; class PushNotificationsManager { bool _initialized = false; @@ -24,8 +18,8 @@ class PushNotificationsManager { Future init() async { if (_initialized) return; - await _initializeSocket(); - if (!kIsWeb) await _initializeFireBase(); + _initializeSocket(); + await _initializeFireBase(); _initialized = true; } @@ -54,7 +48,7 @@ class PushNotificationsManager { } void _initializeSocket() async { - var url = "https://ws.anypayinc.com?token=${Authentication.token}"; + var url = "https://ws.anypayx.com?token=${Authentication.token}"; IO.Socket socket = IO.io(url, { 'transports': ['websocket'] }); @@ -64,22 +58,26 @@ class PushNotificationsManager { socket.on('message', _triggerSocketMessage); } - Future _handleMessage( - RemoteMessage message) async { + Future _handleMessage(RemoteMessage? message) async { if (message != null) { AppController.openPath(message.data['path']); } } - void _initializeFireBase() async { + Future _initializeFireBase() async { print("INIT FIREBASE"); // For iOS request permission first. FirebaseMessaging.instance.requestPermission(); - FirebaseMessaging.instance.getInitialMessage().then(_handleMessage); + FirebaseMessaging.instance.getInitialMessage().then((value) => _handleMessage(value)); FirebaseMessaging.onBackgroundMessage(_handleMessage); - String token = await FirebaseMessaging.instance.getToken(); - print("FirebaseMessaging token: $token"); - await Client.setFireBaseToken(token); + String? token = await FirebaseMessaging.instance.getToken(); + + if (token != null) { + print("FirebaseMessaging token: $token"); + await Client.setFireBaseToken(token); + } else { + print("FirebaseMessaging token is null"); + } } } diff --git a/lib/router.dart b/lib/router.dart index 6805ff21..8f2dcbd3 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -19,7 +19,7 @@ class AnyFluroRouter { static FluroRouter router = FluroRouter(); static newHandler(klass, [key]) { - return Handler(handlerFunc: (BuildContext context, Map params) { + return Handler(handlerFunc: (BuildContext? context, Map params) { if (key == null) return klass(); else return klass(params[key][0]); }); diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index 47f2545e..2424856e 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -13,9 +13,9 @@ class Addresses extends StatelessWidget { } class AddressesPage extends StatefulWidget { - AddressesPage({Key key, this.title}) : super(key: key); + AddressesPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _AddressesPageState createState() => _AddressesPageState(); diff --git a/lib/routes/create_account.dart b/lib/routes/create_account.dart index 6012e394..4a69bbdb 100644 --- a/lib/routes/create_account.dart +++ b/lib/routes/create_account.dart @@ -13,9 +13,9 @@ class CreateAccount extends StatelessWidget { } class CreateAccountPage extends StatefulWidget { - CreateAccountPage({Key key, this.title}) : super(key: key); + CreateAccountPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _CreateAccountPageState createState() => _CreateAccountPageState(); @@ -47,7 +47,7 @@ class _CreateAccountPageState extends State { ), _textFields(), Container( - margin: (_submitting ? + margin: (_submitting ? EdgeInsets.only(top: 5, bottom: 10) : EdgeInsets.only(top: 20, bottom: 20)), child: _submitting ? SpinKitCircle(color: AppController.blue) : @@ -82,7 +82,7 @@ class _CreateAccountPageState extends State { void _submitForm() { _closeKeyboard(); - if (_formKey.currentState.validate()) { + if (_formKey.currentState!.validate()) { setState(() { _errorMessage = ""; _submitting = true; @@ -130,7 +130,7 @@ class _CreateAccountPageState extends State { labelText: 'Email' ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; + if (value == null || value.isEmpty) return 'Please enter some text'; else if (!EmailValidator.validate(value.trim())) return "That doesn't look like an email address"; }, @@ -145,7 +145,7 @@ class _CreateAccountPageState extends State { labelText: 'Password' ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; + if (value == null || value.isEmpty) return 'Please enter some text'; else if (confirmPassword.text != value) return 'Passwords do not match.'; }, @@ -160,7 +160,7 @@ class _CreateAccountPageState extends State { labelText: 'Re-type Password' ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; + if (value == null || value.isEmpty) return 'Please enter some text'; }, onFieldSubmitted: (value) { _submitForm(); diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index c4535416..a1db5091 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -18,9 +18,9 @@ class EditBusinessInfo extends StatelessWidget { } class EditBusinessInfoPage extends StatefulWidget { - EditBusinessInfoPage({Key key, this.allowBack}) : super(key: key); + EditBusinessInfoPage({Key? key, this.allowBack}) : super(key: key); - final bool allowBack; + final bool? allowBack; @override _EditBusinessInfoPageState createState() => _EditBusinessInfoPageState(allowBack); @@ -72,9 +72,9 @@ class _EditBusinessInfoPageState extends State { void _rebuild() { setState(() { - address.text = Authentication.currentAccount.physicalAddress; - email.text = Authentication.currentAccount.ambassadorEmail; - name.text = Authentication.currentAccount.businessName; + address.text = Authentication.currentAccount.physicalAddress ?? 'N\\A'; + email.text = Authentication.currentAccount.ambassadorEmail?? 'N\\A'; + name.text = Authentication.currentAccount.businessName?? 'N\\A'; }); } @@ -94,7 +94,7 @@ class _EditBusinessInfoPageState extends State { _successMessage = ""; }); _closeKeyboard(); - if (_formKey.currentState.validate()) { + if (_formKey.currentState != null && _formKey.currentState!.validate()) { Authentication.updateAccount({ 'ambassador_email': email.text.toLowerCase(), 'physical_address': address.text, @@ -147,8 +147,9 @@ class _EditBusinessInfoPageState extends State { labelText: 'Ambassador Email (Optional)' ), validator: (value) { - if (!value.isEmpty && !EmailValidator.validate(value.trim())) + if (value != null && !value.isEmpty && !EmailValidator.validate(value.trim())) return "That doesn't look like an email address"; + return null; }, ), Container( diff --git a/lib/routes/forgot_password.dart b/lib/routes/forgot_password.dart index 0e13052d..474b3842 100644 --- a/lib/routes/forgot_password.dart +++ b/lib/routes/forgot_password.dart @@ -13,9 +13,9 @@ class ForgotPassword extends StatelessWidget { } class ForgotPasswordPage extends StatefulWidget { - ForgotPasswordPage({Key key, this.title}) : super(key: key); + ForgotPasswordPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _ForgotPasswordPageState createState() => _ForgotPasswordPageState(); @@ -37,7 +37,7 @@ class _ForgotPasswordPageState extends State { void _submitForm() { _closeKeyboard(); - if (_formKey.currentState.validate()) { + if (_formKey.currentState != null && _formKey.currentState!.validate()) { setState(() { _submitting = true; _errorMessage = ""; @@ -91,16 +91,20 @@ class _ForgotPasswordPageState extends State { labelText: 'Email' ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; - else if (!EmailValidator.validate(value.trim())) + if (value != null && value.isEmpty) + return 'Please enter some text'; + + if (!EmailValidator.validate(value!.trim())) return "That doesn't look like an email address"; + + return null; }, onFieldSubmitted: (value) { _submitForm(); }, ), Container( - margin: (_submitting ? + margin: (_submitting ? EdgeInsets.only(top: 10, bottom: 5) : EdgeInsets.only(top: 20, bottom: 20)), child: _submitting ? SpinKitCircle(color: AppController.blue) : diff --git a/lib/routes/invoice.dart b/lib/routes/invoice.dart index 6199013d..21b51e38 100644 --- a/lib/routes/invoice.dart +++ b/lib/routes/invoice.dart @@ -29,44 +29,44 @@ class ShowInvoice extends StatelessWidget { } class InvoicePage extends StatefulWidget { - InvoicePage({Key key, this.id}) : super(key: key); + InvoicePage({Key? key, this.id}) : super(key: key); - final String id; + final String? id; @override - _InvoicePageState createState() => _InvoicePageState(id); + _InvoicePageState createState() => _InvoicePageState(id ?? ''); } class _InvoicePageState extends State { _InvoicePageState(this.id); TextEditingController notes = TextEditingController(); - Map chosenPaymentOption; + Map? chosenPaymentOption; bool _showLinkToWalletHelp = false; bool choosingCurrency = false; String _successMessage = ''; bool usePayProtocol = true; bool _invoiceReady = false; bool _submitting = false; - StreamSubscription event; - Timer havingTroubleTimer; + StreamSubscription? event; + Timer? havingTroubleTimer; bool useUrlStyle = true; bool _disposed = false; - Timer periodicRequest; - String _errorMessage; - String notesError; - String currency; - Color qrColor; - String uri; - String id; - - Invoice invoice; - RectGetter sharePlacement; - - Map get bsvPaymentOption => invoice.bsvPaymentOption; + Timer? periodicRequest; + String? _errorMessage; + String? notesError; + String? currency; + Color? qrColor; + String? uri; + String? id; + + Invoice? invoice; + RectGetter? sharePlacement; + + Map? get bsvPaymentOption => invoice != null ? invoice!.bsvPaymentOption : null; List get embedOutputs { if (bsvPaymentOption == null) return []; - return (bsvPaymentOption['outputs'] ?? []).map((output) { + return (bsvPaymentOption!['outputs'] ?? []).map((output) { var _output = {}; _output['amount'] = output['amount']/100000000; _output['to'] = output['address']; @@ -75,13 +75,13 @@ class _InvoicePageState extends State { }).toList(); } - Map arguments; - Merchant merchant; + Map? arguments; + Merchant? merchant; @override Widget build(BuildContext context) { - arguments ??= (ModalRoute.of(context).settings.arguments as Map); - if (arguments != null) merchant ??= arguments['merchant']; + arguments ??= (ModalRoute.of(context)!.settings.arguments as Map); + if (arguments != null) merchant ??= arguments!['merchant']; return GestureDetector( onTap: _closeKeyboard, @@ -113,17 +113,20 @@ class _InvoicePageState extends State { @override void dispose() { - event.cancel(); + event!.cancel(); notes.dispose(); super.dispose(); _disposed = true; - periodicRequest.cancel(); - havingTroubleTimer.cancel(); + periodicRequest!.cancel(); + havingTroubleTimer!.cancel(); } void _copyUri() { - Clipboard.setData(ClipboardData(text: uri)); - setState(() => _successMessage = "Copied!" ); + if (uri != null) { + Clipboard.setData(ClipboardData(text: uri!)); + setState(() => _successMessage = "Copied!" ); + } + Timer(Duration(seconds: 2), () { setState(() => _successMessage = "" ); }); @@ -134,7 +137,9 @@ class _InvoicePageState extends State { } void _openUri() async { - await launchUrlString(uri); + if (uri != null) { + await launchUrlString(uri!); + } } bool hasNotes = false; @@ -146,10 +151,10 @@ class _InvoicePageState extends State { _submitting = true; notesError = ""; }); - periodicRequest.cancel(); + periodicRequest!.cancel(); if (hasNotes) - Client.setInvoiceNotes(invoice.uid, notes.text).then((response) { + Client.setInvoiceNotes(invoice!.uid, notes.text).then((response) { _submitting = false; if (response['success']) { if (merchant == null && Authentication.isAuthenticated()) @@ -167,7 +172,7 @@ class _InvoicePageState extends State { String get backPath { if (invoice != null && !Authentication.isAuthenticated()) - return '/pay/${invoice.accountId}'; + return '/pay/${invoice!.accountId}'; else return '/new-invoice'; } @@ -178,7 +183,7 @@ class _InvoicePageState extends State { } void _chooseCurrency() { - if (invoice.paymentOptions.length > 1) + if (invoice!.paymentOptions!.length > 1) choosingCurrency = true; _rebuild(); } @@ -187,15 +192,16 @@ class _InvoicePageState extends State { var shareUri = "https://anypayx.com/i/${invoice?.uid}"; await Share.share(shareUri, - sharePositionOrigin: sharePlacement.getRect() + sharePositionOrigin: sharePlacement!.getRect() ); } - String getFormat() { + String? getFormat() { if (usePayProtocol) return 'pay'; else if (useUrlStyle) return 'url'; + return null; } void _rebuild() { @@ -212,13 +218,13 @@ class _InvoicePageState extends State { } void _fetchInvoice() { - if (invoice == null || (invoice.isUnpaid() && !invoice.isExpired())) + if (invoice == null || (invoice!.isUnpaid() && !invoice!.isExpired())) Client.getInvoice(id).then((response) { _errorMessage = null; if (response['success']) { invoice = response['invoice']; - if (invoice.paymentOptions.length == 1) { - chosenPaymentOption = invoice.paymentOptions.first; + if (invoice!.paymentOptions!.length == 1) { + chosenPaymentOption = invoice!.paymentOptions!.first; usePayProtocol = false; } } else _errorMessage = response['message']; @@ -259,7 +265,7 @@ class _InvoicePageState extends State { }, ) ), - ...(invoice.paymentOptions.map((option) { + ...(invoice!.paymentOptions!.map((option) { var code = option['chain'] != option['currency'] ? option['currency'] + '_' + option['chain'] : option['currency']; return Container( width: 300, @@ -298,7 +304,7 @@ class _InvoicePageState extends State { ), Container( margin: EdgeInsets.only(top: 20, bottom: 20), - child: Text(invoice.amountWithDenomination(), + child: Text(invoice!.amountWithDenomination(), style: TextStyle( fontWeight: FontWeight.bold, decoration: TextDecoration.lineThrough, @@ -307,7 +313,7 @@ class _InvoicePageState extends State { ), ), ), - Text(invoice.paidAmountWithDenomination(), + Text(invoice!.paidAmountWithDenomination(), style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).primaryColorLight, @@ -416,7 +422,7 @@ class _InvoicePageState extends State { ), Container( margin: EdgeInsets.only(top: AppController.scale(35), bottom: 5), - child: Text(invoice.amountWithDenomination(), + child: Text(invoice!.amountWithDenomination(), style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).primaryColorDark, @@ -425,7 +431,7 @@ class _InvoicePageState extends State { ), ), Visibility( - visible: (invoice.notes ?? []).length > 0, + visible: (invoice!.notes ?? []).length > 0, child: Column( children: [ Text("Order Notes:", @@ -438,7 +444,7 @@ class _InvoicePageState extends State { Container( width: 300, margin: EdgeInsets.only(top: 5), - child: Text(invoice.noteText(), + child: Text(invoice!.noteText(), textAlign: TextAlign.center, style: TextStyle( color: Theme.of(context).primaryColorDark, @@ -459,7 +465,7 @@ class _InvoicePageState extends State { setState(() => hasNotes = value.length > 0); }, validator: (value) { - if (notesError.length > 0) + if (notesError!.length > 0) return notesError; }, decoration: InputDecoration( @@ -553,9 +559,9 @@ class _InvoicePageState extends State { bool _showInvoice() { return invoice != null && - !invoice.isUnderpaid() && - !invoice.isExpired() && - !invoice.isPaid() && + !invoice!.isUnderpaid() && + !invoice!.isExpired() && + !invoice!.isPaid() && !choosingCurrency; } @@ -564,19 +570,20 @@ class _InvoicePageState extends State { return _InvoiceComponent(); else if (invoice == null) if (_errorMessage != null) - return Text(_errorMessage, style: TextStyle(color: AppController.red)); + return Text(_errorMessage!, style: TextStyle(color: AppController.red)); else return Container( child: SpinKitCircle(color: qrColor), height: AppController.scale(360), ); - else if (invoice.isUnderpaid()) + else if (invoice!.isUnderpaid()) return _UnderpaidScreen(); - else if (invoice.isPaid()) + else if (invoice!.isPaid()) return _PaidScreen(); else if (choosingCurrency) return _ChooseCurrencyMenu(); - else if (invoice.isExpired()) + else if (invoice!.isExpired()) return _ExpiredInvoice(); + return Container(); } Widget _InvoiceComponent() { @@ -607,7 +614,8 @@ class _InvoicePageState extends State { children: [ _PaymentTitle(usePayProtocol ? 'anypay' : currency), Visibility( - visible: invoice.paymentOptions.length > 1, + visible: invoice != null && invoice!.paymentOptions != null && + invoice!.paymentOptions!.length > 1, child: Container( width: 40, height: 42, @@ -623,7 +631,7 @@ class _InvoicePageState extends State { shape: RoundedRectangleBorder( side: BorderSide( width: 12.0, - color: qrColor, + color: qrColor!, ), borderRadius: BorderRadius.all(Radius.circular(18.0)), ), @@ -633,11 +641,11 @@ class _InvoicePageState extends State { child: GestureDetector( behavior: HitTestBehavior.translucent, onTap: _toggleUrlStyle, - child: QrImage( + child: QrImageView( foregroundColor: Color(0xFF404040), version: QrVersions.auto, size: AppController.scale(200, maxValue: 280, minValue: 100), - data: uri, + data: uri!, ), ), ), @@ -698,7 +706,7 @@ class _InvoicePageState extends State { _rebuild(); }; return Visibility( - visible: invoice == null || (!invoice.isExpired() && invoice.isUnpaid()) || invoice.isUnderpaid(), + visible: invoice == null || (!invoice!.isExpired() && invoice!.isUnpaid()) || invoice!.isUnderpaid(), child: CircleBackButton( margin: margin ?? EdgeInsets.only(top: AppController.scale(15.0), bottom: 20.0), backPath: backPath, diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 9bdb8090..6c6cbc9d 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:email_validator/email_validator.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:app/app_controller.dart'; @@ -12,9 +14,9 @@ class Login extends StatelessWidget { } class LoginPage extends StatefulWidget { - LoginPage({Key key, this.title}) : super(key: key); + LoginPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _LoginPageState createState() => _LoginPageState(); @@ -59,17 +61,21 @@ class _LoginPageState extends State { } void _submitForm() { - if (_formKey.currentState.validate()) { + if (_formKey.currentState!.validate()) { setState(() { _submitting = true; _errorMessage = ""; }); Client.authenticate(email.text, password.text).then((response) { _submitting = false; - if (response['success']) + if (response['success']) { AppController.closeUntilPath('/new-invoice'); + } else setState(() { - _errorMessage = response['message']; + print(jsonEncode(response)); + var body = response['body']; + var payload = body['payload']; + _errorMessage = payload['message']; }); }); } @@ -101,9 +107,10 @@ class _LoginPageState extends State { labelText: 'Email' ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; - else if (!EmailValidator.validate(value.trim())) + if (value != null && value.isEmpty) return 'Please enter some text'; + else if (!EmailValidator.validate(value!.trim())) return "That doesn't look like an email address"; + return null; }, onFieldSubmitted: (value) { _submitForm(); @@ -116,7 +123,8 @@ class _LoginPageState extends State { labelText: 'Password', ), validator: (value) { - if (value.isEmpty) return 'Please enter some text'; + if (value != null && value.isEmpty) return 'Please enter some text'; + return null; }, onFieldSubmitted: (value) { _submitForm(); diff --git a/lib/routes/navigation.dart b/lib/routes/navigation.dart index 738d1826..c0bd970c 100644 --- a/lib/routes/navigation.dart +++ b/lib/routes/navigation.dart @@ -12,9 +12,9 @@ class Navigation extends StatelessWidget { } class NavigationPage extends StatefulWidget { - NavigationPage({Key key, this.title}) : super(key: key); + NavigationPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _NavigationPageState createState() => _NavigationPageState(); @@ -116,7 +116,7 @@ class _NavigationPageState extends State { ), onTap: () { AppController.toggleDarkMode(); - AppController.of(context).rebuild(); + AppController.of(context)!.rebuild(); } ), ); diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index 797e994c..b78a53fe 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -22,12 +22,12 @@ class NewAddress extends StatelessWidget { } class NewAddressPage extends StatefulWidget { - NewAddressPage({Key key, this.code}) : super(key: key); + NewAddressPage({Key? key, this.code}) : super(key: key); - final String code; + final String? code; @override - _NewAddressPageState createState() => _NewAddressPageState(code); + _NewAddressPageState createState() => _NewAddressPageState(code ?? ''); } class _NewAddressPageState extends State { @@ -47,7 +47,7 @@ class _NewAddressPageState extends State { String _noteError = ''; String _message = ''; String _note = ''; - Address _address; + Address? _address; @override Widget build(BuildContext context) { @@ -126,7 +126,7 @@ class _NewAddressPageState extends State { setState(() { _address = Authentication.currentAccount.addressFor(this.code); _note = _address?.note ?? ""; - _message = _address?.toString(); + _message = _address?.toString() ?? ""; _messageType = 'success'; }); } @@ -145,8 +145,8 @@ class _NewAddressPageState extends State { } void _pasteAddress() async { - ClipboardData clipboard = await Clipboard.getData('text/plain'); - if (clipboard.text == null || clipboard.text == '') { + ClipboardData? clipboard = await Clipboard.getData('text/plain'); + if (clipboard != null && clipboard.text == null || clipboard!.text == '') { _message = 'Nothing to paste'; _messageType = 'error'; return; @@ -164,15 +164,17 @@ class _NewAddressPageState extends State { setState(() { _savingNote = true; }); - Client.setAddressNote(_address.id, _note).then((response) { - if (!_disposed) - setState(() { - if (response['success']) { - _savingNote = false; - _address.note = _note; - } else _noteError = response['message']; - }); - }); + if (_address != null) { + Client.setAddressNote(_address!.id, _note).then((response) { + if (!_disposed) + setState(() { + if (response['success']) { + _savingNote = false; + _address!.note = _note; + } else _noteError = response['message']; + }); + }); + } } void _setAddress(address) async { @@ -221,7 +223,7 @@ class _NewAddressPageState extends State { AppController.closeUntilPath('/new-invoice'); } - Color _messageColor() { + Color? _messageColor() { return { 'pending': Theme.of(context).primaryColorDark, 'success': AppController.green, diff --git a/lib/routes/new_invoice.dart b/lib/routes/new_invoice.dart index 944f9908..bb524324 100644 --- a/lib/routes/new_invoice.dart +++ b/lib/routes/new_invoice.dart @@ -14,19 +14,19 @@ import 'dart:math'; class NewInvoice extends StatelessWidget { NewInvoice({this.merchantId}); - final String merchantId; + final String? merchantId; @override Widget build(BuildContext context) { - return NewInvoicePage(merchantId: merchantId); + return NewInvoicePage(merchantId: merchantId ?? ''); } } class NewInvoicePage extends StatefulWidget { - NewInvoicePage({Key key, this.merchantId}) : super(key: key); + NewInvoicePage({Key? key, this.merchantId}) : super(key: key); - final String merchantId; + final String? merchantId; @override _NewInvoicePageState createState() => _NewInvoicePageState(merchantId: merchantId); @@ -38,9 +38,9 @@ class _NewInvoicePageState extends State { String _visiblePrice = ''; String _errorMessage = ''; bool _submitting = false; - Merchant merchant; - String merchantId; - Invoice _invoice; + Merchant? merchant; + String? merchantId; + Invoice? _invoice; num _price = 0; @override @@ -96,7 +96,7 @@ class _NewInvoicePageState extends State { }); } - String get preferredCoinCode { + String? get preferredCoinCode { return merchant?.denomination ?? Authentication.currentAccount.preferredCoinCode; } @@ -141,7 +141,7 @@ class _NewInvoicePageState extends State { void _checkForDarkMode() { AppController.checkForDarkMode(context).then((_) { - AppController.of(context).rebuild(); + AppController.of(context)!.rebuild(); }); } @@ -158,7 +158,7 @@ class _NewInvoicePageState extends State { return Container( width: double.infinity, margin: EdgeInsets.only(top: 10, bottom: 10), - child: Text(merchant.name, + child: Text(merchant!.name ?? '', textAlign: TextAlign.center, style: TextStyle( shadows: [ @@ -169,7 +169,7 @@ class _NewInvoicePageState extends State { ), ], fontWeight: FontWeight.bold, - fontSize: (65 - 1.5*max(merchant.name.length-8, 0)).toDouble(), + fontSize: (65 - 1.5*max(merchant!.name!.length-8, 0)).toDouble(), ) ) ); @@ -256,11 +256,11 @@ class _NewInvoicePageState extends State { void _setVisiblePrice() { _setInvoice(); - _visiblePrice = _invoice.amountWithDenomination(); + _visiblePrice = _invoice!.amountWithDenomination(); } void _backspace() { - var denominator = pow(10, _invoice.decimalPlaces()); + var denominator = pow(10, _invoice!.decimalPlaces()); _price = (_price * 0.1 * denominator).truncateToDouble()/denominator; _errorMessage = ""; _rebuild(); @@ -268,7 +268,7 @@ class _NewInvoicePageState extends State { void _updatePrice(i) { if (_price >= 92233720368547.76) return; - var denominator = pow(10, _invoice.decimalPlaces()); + var denominator = pow(10, _invoice!.decimalPlaces()); _price = (_price * 10 * denominator + i).round().toDouble()/denominator; _errorMessage = ""; _rebuild(); diff --git a/lib/routes/payment.dart b/lib/routes/payment.dart index edf9572b..2949e2f8 100644 --- a/lib/routes/payment.dart +++ b/lib/routes/payment.dart @@ -21,12 +21,12 @@ class Payment extends StatelessWidget { } class PaymentPage extends StatefulWidget { - PaymentPage({Key key, this.id}) : super(key: key); + PaymentPage({Key? key, this.id}) : super(key: key); - final String id; + final String? id; @override - _PaymentPageState createState() => _PaymentPageState(id); + _PaymentPageState createState() => _PaymentPageState(id ?? ''); } class _PaymentPageState extends State { @@ -34,8 +34,8 @@ class _PaymentPageState extends State { final String id; String _errorMessage = ''; - Invoice _payment; - String _notes; + Invoice? _payment; + String? _notes; @override Widget build(BuildContext context) { @@ -64,7 +64,9 @@ class _PaymentPageState extends State { setState(() { if (response['success']) { _payment = response['invoice']; - _notes = _payment.orderNotes(); + if (_payment != null) { + _notes = _payment!.orderNotes(); + } } else _errorMessage = response['message']; }); }); @@ -75,9 +77,9 @@ class _PaymentPageState extends State { return SpinKitCircle(color: AppController.blue); var denominationCurrencyName = - (Coins.all[_payment.currency] ?? {})['name'] ?? '...'; - var denominationCurrencyAmount = (_payment.invoiceAmountPaid != null - ? (_payment.invoiceAmountPaid / pow(10, Coins.all[_payment.currency]['decimals'])).toString() + (Coins.all[_payment!.currency] ?? {})['name'] ?? '...'; + var denominationCurrencyAmount = (_payment!.invoiceAmountPaid != null + ? (_payment!.invoiceAmountPaid! / pow(10, Coins.all[_payment!.currency]['decimals'])).toString() : '...'); var denominationCurrencyText = denominationCurrencyName + ' ' + denominationCurrencyAmount; @@ -88,7 +90,7 @@ class _PaymentPageState extends State { Text(_errorMessage, style: TextStyle(color: AppController.red)), Container( margin: EdgeInsets.only(bottom: 40), - child: Text(_payment.amountWithDenomination() ?? "", + child: Text(_payment!.amountWithDenomination() ?? "", style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).primaryColorLight, @@ -107,7 +109,7 @@ class _PaymentPageState extends State { ), ), Container( - child: Text(_payment.completedAtTimeAgo(), + child: Text(_payment!.completedAtTimeAgo(), style: TextStyle( color: Theme.of(context).primaryColorDark, fontSize: 20, @@ -117,7 +119,7 @@ class _PaymentPageState extends State { Container( margin: EdgeInsets.only(bottom: 40), child: Text( - _payment.formatCompletedAt(), + _payment!.formatCompletedAt(), style: TextStyle( color: Theme.of(context).primaryColorDark, fontSize: 20, @@ -125,10 +127,10 @@ class _PaymentPageState extends State { ), ), Visibility( - visible: _notes.length > 0, + visible: _notes!.length > 0, child: Container( margin: EdgeInsets.only(right: 10), - child: Text(_notes, + child: Text(_notes!, textAlign: TextAlign.center, style: TextStyle( color: Theme.of(context).primaryColorDark, @@ -138,11 +140,11 @@ class _PaymentPageState extends State { ), ), Visibility( - visible: _payment.getBlockchainUrl() != null, + visible: _payment!.getBlockchainUrl() != null, child: Container( child: GestureDetector( onTap: () async { - await launch(_payment.getBlockchainUrl()); + await launch(_payment!.getBlockchainUrl()!); }, child: Text('View on blockchain', style: TextStyle( diff --git a/lib/routes/payments.dart b/lib/routes/payments.dart index f64908aa..09cfdd6b 100644 --- a/lib/routes/payments.dart +++ b/lib/routes/payments.dart @@ -14,7 +14,7 @@ class Payments extends StatelessWidget { } class PaymentsPage extends StatefulWidget { - PaymentsPage({Key key}) : super(key: key); + PaymentsPage({Key? key}) : super(key: key); @override _PaymentsPageState createState() => _PaymentsPageState(); @@ -24,7 +24,7 @@ class _PaymentsPageState extends State { bool _awaitingResponse = true; bool _showMore = false; var allInvoices = []; - String _errorMessage; + String? _errorMessage; num page = 0; @override @@ -86,7 +86,7 @@ class _PaymentsPageState extends State { List _InvoiceList() { if (_errorMessage != null) - return [Text(_errorMessage, textAlign: TextAlign.center, style: TextStyle(color: AppController.red))]; + return [Text(_errorMessage!, textAlign: TextAlign.center, style: TextStyle(color: AppController.red))]; else if (allInvoices.length == 0) return [ Container( diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index f8b61b64..e733b09f 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -1,11 +1,9 @@ import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:email_validator/email_validator.dart'; import 'package:app/authentication.dart'; import 'package:app/app_controller.dart'; import 'package:flutter/material.dart'; import 'package:app/back_button.dart'; import 'package:app/currencies.dart'; -import 'package:app/client.dart'; class SetCurrency extends StatelessWidget { @override @@ -15,9 +13,9 @@ class SetCurrency extends StatelessWidget { } class SetCurrencyPage extends StatefulWidget { - SetCurrencyPage({Key key, this.title}) : super(key: key); + SetCurrencyPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _SetCurrencyPageState createState() => _SetCurrencyPageState(); @@ -26,7 +24,7 @@ class SetCurrencyPage extends StatefulWidget { class _SetCurrencyPageState extends State { Map visibleCurrencies = Currencies.all; String _errorMessage = ''; - String _chosenCurrency; + String? _chosenCurrency; @override Widget build(BuildContext context) { diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index b41c9f10..ddf799c8 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -12,9 +12,9 @@ class Settings extends StatelessWidget { } class SettingsPage extends StatefulWidget { - SettingsPage({Key key, this.title}) : super(key: key); + SettingsPage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _SettingsPageState createState() => _SettingsPageState(); @@ -71,7 +71,7 @@ class _SettingsPageState extends State { void _rebuild() { setState(() { denomination = Authentication.currentAccount.denomination ?? 'USD'; - symbol = Currencies.all[denomination]['symbol']; + symbol = Currencies.all[denomination]!['symbol']; }); } diff --git a/lib/web_storage.dart b/lib/web_storage.dart deleted file mode 100644 index 80fe9915..00000000 --- a/lib/web_storage.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:universal_html/html.dart' show window; - -class Storage { - static Future read(String key) async { - return await window.localStorage[key]; - } - - static Future write(String key, String value) async { - window.localStorage[key] = value; - } - - static Future delete(String key) async { - window.localStorage[key] = null; - } -} From 93c5ccde62f774a1e23fbf3e097acf57c08f3e68 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 00:12:19 +0400 Subject: [PATCH 03/57] Add brightness --- lib/main.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 1516d1f4..cd09869a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,15 +27,15 @@ class Anypay extends StatelessWidget { primaryColorDark: Color(0xFF707070), primaryColorLight: Color(0xFF404040), brightness: Brightness.light, - colorScheme: ColorScheme.fromSwatch() - .copyWith(secondary: AppController.blue), + colorScheme: ColorScheme.fromSwatch().copyWith( + secondary: AppController.blue, brightness: Brightness.light), fontFamily: 'Ubuntu', ); var darkTheme = ThemeData( primaryColorDark: Color(0xffCCCCCC), primaryColorLight: Color(0xFFFFFFFF), - colorScheme: ColorScheme.fromSwatch() - .copyWith(secondary: Color(0xff2196f3)), + colorScheme: ColorScheme.fromSwatch().copyWith( + secondary: Color(0xff2196f3), brightness: Brightness.dark), brightness: Brightness.dark, fontFamily: 'Ubuntu', ); From cc4d9e27f73ed8f9017f56042bf5ed9a0f991eec Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 00:12:36 +0400 Subject: [PATCH 04/57] Fix fluro router --- lib/main.dart | 2 +- lib/router.dart | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index cd09869a..873c9df3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -54,7 +54,7 @@ class Anypay extends StatelessWidget { child: child!, ); }, - initialRoute: isAuthenticated ? '/new-invoice' : '/login', + initialRoute: isAuthenticated ? 'new-invoice' : 'login', onGenerateRoute: AnyFluroRouter.router.generator, navigatorKey: AppController.globalKey, title: 'Anypay Cash Register', diff --git a/lib/router.dart b/lib/router.dart index 8f2dcbd3..d18fc403 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -27,77 +27,77 @@ class AnyFluroRouter { static void setupRouter() { router.define( - '/login', + 'login', handler: newHandler(() => Login()), transitionType: TransitionType.fadeIn, ); router.define( - '/registration', + 'registration', handler: newHandler(() => CreateAccount()), transitionType: TransitionType.inFromBottom, ); router.define( - '/register-business', + 'register-business', handler: newHandler(() => EditBusinessInfo(allowBack: false)), transitionType: TransitionType.inFromBottom, ); router.define( - '/password-reset', + 'password-reset', handler: newHandler(() => ForgotPassword()), transitionType: TransitionType.inFromBottom, ); router.define( - '/invoices/:id', + 'invoices/:id', handler: newHandler((id) => ShowInvoice(id), 'id'), transitionType: TransitionType.inFromBottom, ); router.define( - '/new-invoice', + 'new-invoice', handler: newHandler(() => NewInvoice()), transitionType: TransitionType.inFromBottom, ); router.define( - '/navigation', + 'navigation', handler: newHandler(() => Navigation()), transitionType: TransitionType.inFromBottom, ); router.define( - '/settings', + 'settings', handler: newHandler(() => Settings()), transitionType: TransitionType.inFromBottom, ); router.define( - '/settings/business-info', + 'settings/business-info', handler: newHandler(() => EditBusinessInfo()), transitionType: TransitionType.inFromBottom, ); router.define( - '/settings/currency', + 'settings/currency', handler: newHandler(() => SetCurrency()), transitionType: TransitionType.inFromBottom, ); router.define( - '/settings/addresses', + 'settings/addresses', handler: newHandler(() => Addresses()), transitionType: TransitionType.inFromBottom, ); router.define( - '/payments', + 'payments', handler: newHandler(() => Payments()), transitionType: TransitionType.inFromBottom, ); router.define( - '/payments/:id', + 'payments/:id', handler: newHandler((id) => Payment(id), 'id'), transitionType: TransitionType.inFromBottom, ); router.define( - '/pay/:id', + 'pay/:id', handler: newHandler((id) => NewInvoice(merchantId: id), 'id'), transitionType: TransitionType.inFromBottom, ); router.define( - '/new-address/:code', + 'new-address/:code', handler: newHandler((code) => NewAddress(code), 'code'), transitionType: TransitionType.inFromBottom, ); From 252fb1844d72f5c028b81bcec97cee2df031475f Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 00:44:13 +0400 Subject: [PATCH 05/57] Migrate color schemes --- lib/main.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 873c9df3..ab8032d2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -23,19 +23,25 @@ class Anypay extends StatelessWidget { Widget build(BuildContext context) { return AppController(builder: (context) { var theme; + var lightTheme = ThemeData( primaryColorDark: Color(0xFF707070), primaryColorLight: Color(0xFF404040), brightness: Brightness.light, colorScheme: ColorScheme.fromSwatch().copyWith( - secondary: AppController.blue, brightness: Brightness.light), + background: AppController.white, + secondary: AppController.blue, + brightness: Brightness.light), fontFamily: 'Ubuntu', ); + var darkTheme = ThemeData( primaryColorDark: Color(0xffCCCCCC), primaryColorLight: Color(0xFFFFFFFF), colorScheme: ColorScheme.fromSwatch().copyWith( - secondary: Color(0xff2196f3), brightness: Brightness.dark), + background: Color(0xff222222), + secondary: Color(0xff2196f3), + brightness: Brightness.dark), brightness: Brightness.dark, fontFamily: 'Ubuntu', ); From a254d026e59097ad0062dd15ff17435292981873 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 00:45:53 +0400 Subject: [PATCH 06/57] Make builder non nullable --- lib/app_controller.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/app_controller.dart b/lib/app_controller.dart index 816d56ee..5c22afe3 100644 --- a/lib/app_controller.dart +++ b/lib/app_controller.dart @@ -6,7 +6,7 @@ import 'dart:math'; import 'package:app/native_storage.dart'; class AppController extends StatefulWidget { - final Function(BuildContext)? builder; + final Function(BuildContext) builder; static final globalKey = new GlobalKey(); static bool enableDarkMode = false; @@ -138,9 +138,7 @@ class AppController extends StatefulWidget { openedPath = path; } - const AppController( - {Key? key, this.builder}) - : super(key: key); + const AppController({Key? key, required this.builder}) : super(key: key); @override AppControllerState createState() => new AppControllerState(); @@ -154,7 +152,7 @@ class AppControllerState extends State { @override Widget build(BuildContext context) { - return widget.builder!(context); + return widget.builder(context); } void rebuild() { From 7991505675381f2efb85cf1cfb2d9db24c3803ed Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 01:22:43 +0400 Subject: [PATCH 07/57] Merchant id should be null --- lib/routes/new_invoice.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/new_invoice.dart b/lib/routes/new_invoice.dart index bb524324..ab32a4ae 100644 --- a/lib/routes/new_invoice.dart +++ b/lib/routes/new_invoice.dart @@ -18,7 +18,7 @@ class NewInvoice extends StatelessWidget { @override Widget build(BuildContext context) { - return NewInvoicePage(merchantId: merchantId ?? ''); + return NewInvoicePage(merchantId: merchantId); } } From 095ad6b41d99e2e272e07cc0140fb9a5a3385fb9 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 04:15:54 +0400 Subject: [PATCH 08/57] Nullability fixes --- lib/models/account.dart | 4 ++-- lib/models/invoice.dart | 9 ++++++++- lib/routes/new_address.dart | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/models/account.dart b/lib/models/account.dart index 6d95e607..a850bd01 100644 --- a/lib/models/account.dart +++ b/lib/models/account.dart @@ -25,8 +25,8 @@ class Account { return jsonEncode(toMap()); } - Address addressFor(code) { - return addresses[code]; + Address? addressFor(code) { + return addresses[code] ?? null; } String? get preferredCoinCode { diff --git a/lib/models/invoice.dart b/lib/models/invoice.dart index d1376a1c..aa07a5b1 100644 --- a/lib/models/invoice.dart +++ b/lib/models/invoice.dart @@ -75,7 +75,14 @@ class Invoice { } int decimalPlaces() { - return (Currencies.all[denominationCurrency] ?? {})['decimal_places'] as int ?? 2; + var decimalPlaces = (Currencies.all[denominationCurrency] ?? + {})['decimal_places']; + + if (decimalPlaces != null) { + return decimalPlaces as int; + } + + return 2; } String paidAmountWithDenomination() { diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index b78a53fe..f714b661 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -22,12 +22,12 @@ class NewAddress extends StatelessWidget { } class NewAddressPage extends StatefulWidget { - NewAddressPage({Key? key, this.code}) : super(key: key); + NewAddressPage({Key? key, required this.code}) : super(key: key); - final String? code; + final String code; @override - _NewAddressPageState createState() => _NewAddressPageState(code ?? ''); + _NewAddressPageState createState() => _NewAddressPageState(code); } class _NewAddressPageState extends State { From 0058d9e655abf7bf56b91908f38feaac8b9e7525 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 13:27:53 +0400 Subject: [PATCH 09/57] Fallback message --- lib/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.dart b/lib/client.dart index e656ff36..86443d52 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -214,7 +214,7 @@ class Client { http.Response response = await http.Response.fromStream(streamedResponse); var responseBody = (json.decode(response.body) as Map); - var message = responseBody['message']; + var message = responseBody['message'] ?? ''; var code = response.statusCode; // For debugging: From 64581ff125275f0c269835c064d4fc31a48d9ee0 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 21:46:55 +0400 Subject: [PATCH 10/57] Cleanup AppController --- lib/app_controller.dart | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/app_controller.dart b/lib/app_controller.dart index 5c22afe3..fb68eecd 100644 --- a/lib/app_controller.dart +++ b/lib/app_controller.dart @@ -43,7 +43,7 @@ class AppController extends StatefulWidget { static Future checkForDarkMode(context) { return Storage.read('enableDarkMode').then((darkMode) { if (darkMode == null) - enableDarkMode = SchedulerBinding.instance.window.platformBrightness == Brightness.dark; + enableDarkMode = SchedulerBinding.instance.platformDispatcher.platformBrightness == Brightness.dark; else if (darkMode != 'false') enableDarkMode = true; }); } @@ -78,6 +78,14 @@ class AppController extends StatefulWidget { ].toList(); static BuildContext getCurrentContext() { + if (globalKey.currentState == null) { + throw 'GlobalKey current state is not available'; + } + + if (globalKey.currentState!.overlay == null) { + throw 'GlobalKey current state overlay is not available'; + } + return globalKey.currentState!.overlay!.context; } @@ -90,11 +98,16 @@ class AppController extends StatefulWidget { } static void openDialog(title, body, {path, buttonText, buttons}) async { - if (dialogIsOpen) return; + if (dialogIsOpen) { + return; + } + dialogIsOpen = true; var context = getCurrentContext(); + buttons ??= []; + showDialog( context: context, builder: (context) => AlertDialog( @@ -118,8 +131,9 @@ class AppController extends StatefulWidget { onPressed: () { dialogIsOpen = false; Navigator.of(context).pop(); - if (path != null) + if (path != null) { openPath(path); + } }, ), ], @@ -132,9 +146,12 @@ class AppController extends StatefulWidget { } static void openPath(String? path) async { - if (path != null && openedPath != path) + if (path != null && openedPath != path) { Navigator.pushNamed(getCurrentContext(), path); + } + Timer(Duration(milliseconds: 5000), () => openedPath = null); + openedPath = path; } From 122088e7d85e0be3e5dc42f3910101e70ad973eb Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 21:56:14 +0400 Subject: [PATCH 11/57] Cleanup client.dart --- lib/client.dart | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/client.dart b/lib/client.dart index 86443d52..2f6ad3c7 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -8,10 +8,10 @@ import 'dart:io'; class Client { static final protocol = 'https'; - static final domain = 'anypay.pshenmic.dev'; + static final domain = 'api.anypayx.com'; static final host = "$protocol://$domain"; - static String humanize(str) { + static String humanize(String str) { if (str.length > 0) return StringUtils.capitalize(str); else @@ -35,15 +35,11 @@ class Client { } static Future> fetchCoins() async { - var req = await makeRequest('get', + return makeRequest('get', unauthorized: (() => Authentication.logout()), requireAuth: true, path: '/coins', ); - - print(jsonEncode(req)); - - return req; } static Future> fetchAccountAddresses() async { @@ -214,7 +210,7 @@ class Client { http.Response response = await http.Response.fromStream(streamedResponse); var responseBody = (json.decode(response.body) as Map); - var message = responseBody['message'] ?? ''; + var message = responseBody['message']; var code = response.statusCode; // For debugging: @@ -234,7 +230,7 @@ class Client { }; } else return { 'success': code == 200, - 'message': humanize(message), + 'message': humanize(message ?? ''), 'body': responseBody, }; } on SocketException catch (_) { From 61a109c85b5d3a51dfc91b969a43b88794e8d393 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 21:57:52 +0400 Subject: [PATCH 12/57] Improve humanize --- lib/client.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/client.dart b/lib/client.dart index 2f6ad3c7..d202bef9 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -12,10 +12,7 @@ class Client { static final host = "$protocol://$domain"; static String humanize(String str) { - if (str.length > 0) - return StringUtils.capitalize(str); - else - return ""; + return StringUtils.capitalize(str); } static String buildAuthHeader() { From 2e3453675474dbf41eb839246d774f2f29be176a Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 22:04:00 +0400 Subject: [PATCH 13/57] Remove slashes in fluro routes --- lib/routes/addresses.dart | 2 +- lib/routes/edit_business_info.dart | 3 +-- lib/routes/login.dart | 4 ++-- lib/routes/navigation.dart | 5 ++--- lib/routes/new_invoice.dart | 8 ++++---- lib/routes/payments.dart | 4 +--- lib/routes/set_currency.dart | 2 +- lib/routes/settings.dart | 6 +++--- 8 files changed, 15 insertions(+), 19 deletions(-) diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index 2424856e..93c13c1b 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -66,7 +66,7 @@ class _AddressesPageState extends State { child: GestureDetector( behavior: HitTestBehavior.translucent, onTap: () => { - Navigator.pushNamed(context, '/new-address/$code') + Navigator.pushNamed(context, 'new-address/$code') }, child: Row( children: [ diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index a1db5091..b1a9add4 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -4,7 +4,6 @@ import 'package:app/authentication.dart'; import 'package:app/app_controller.dart'; import 'package:flutter/material.dart'; import 'package:app/back_button.dart'; -import 'package:app/client.dart'; class EditBusinessInfo extends StatelessWidget { EditBusinessInfo({this.allowBack = true}); @@ -103,7 +102,7 @@ class _EditBusinessInfoPageState extends State { setState(() { _submitting = false; if (!allowBack) - Navigator.pushNamedAndRemoveUntil(context, '/settings/addresses', (Route route) => false); + Navigator.pushNamedAndRemoveUntil(context, 'settings/addresses', (Route route) => false); else if (response['success']) _successMessage = "Saved!"; else _errorMessage = response['message']; diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 6c6cbc9d..68301c8b 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -162,7 +162,7 @@ class _LoginPageState extends State { fontSize: 18, )), onTap: () { - Navigator.pushNamed(context, '/registration'); + Navigator.pushNamed(context, 'registration'); } ), ), @@ -178,7 +178,7 @@ class _LoginPageState extends State { fontSize: 18, )), onTap: () { - Navigator.pushNamed(context, '/password-reset'); + Navigator.pushNamed(context, 'password-reset'); } ), ] diff --git a/lib/routes/navigation.dart b/lib/routes/navigation.dart index c0bd970c..10f72f99 100644 --- a/lib/routes/navigation.dart +++ b/lib/routes/navigation.dart @@ -2,7 +2,6 @@ import 'package:app/authentication.dart'; import 'package:app/app_controller.dart'; import 'package:flutter/material.dart'; import 'package:app/back_button.dart'; -import 'package:app/client.dart'; class Navigation extends StatelessWidget { @override @@ -65,7 +64,7 @@ class _NavigationPageState extends State { fontSize: 22, )), onTap: () { - Navigator.pushNamed(context, '/payments'); + Navigator.pushNamed(context, 'payments'); } ), ), @@ -79,7 +78,7 @@ class _NavigationPageState extends State { fontSize: 22, )), onTap: () { - Navigator.pushNamed(context, '/settings'); + Navigator.pushNamed(context, 'settings'); } ), ), diff --git a/lib/routes/new_invoice.dart b/lib/routes/new_invoice.dart index ab32a4ae..f84e67f6 100644 --- a/lib/routes/new_invoice.dart +++ b/lib/routes/new_invoice.dart @@ -112,7 +112,7 @@ class _NewInvoicePageState extends State { Client.createInvoice(_price, preferredCoinCode, accountId: merchant?.accountId).then((response) { if (response['success']) { var invoiceId = response['invoiceId']; - Navigator.pushNamed(context, '/invoices/$invoiceId', arguments: { + Navigator.pushNamed(context, 'invoices/$invoiceId', arguments: { 'redirectUrl': merchant != null ? (window.document as HtmlDocument).referrer : null, 'merchant': merchant, }).then((_) { @@ -123,7 +123,7 @@ class _NewInvoicePageState extends State { _submitting = false; }); }); - else Navigator.pushNamed(context, '/settings/addresses').then((result) { + else Navigator.pushNamed(context, 'settings/addresses').then((result) { _submitting = false; _rebuild(); }); @@ -231,7 +231,7 @@ class _NewInvoicePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ !Authentication.isAuthenticated()? Container() : GestureDetector( - onTap: () => Navigator.pushNamed(context, '/navigation').then((value) => _rebuild()), + onTap: () => Navigator.pushNamed(context, 'navigation').then((value) => _rebuild()), child: Container( margin: EdgeInsets.only(top: 10.0, left: AppController.leftPadding() + 30), child: Icon(Icons.menu, size: 20+AppController.scale(20.0)), @@ -249,7 +249,7 @@ class _NewInvoicePageState extends State { void _setInvoice() { _invoice = Invoice( - denominationCurrency: merchant?.denomination ?? Authentication.currentAccount?.denomination, + denominationCurrency: merchant?.denomination ?? Authentication.currentAccount.denomination, denominationAmount: _price, ); } diff --git a/lib/routes/payments.dart b/lib/routes/payments.dart index 09cfdd6b..2bcb835c 100644 --- a/lib/routes/payments.dart +++ b/lib/routes/payments.dart @@ -1,10 +1,8 @@ import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:app/authentication.dart'; import 'package:app/app_controller.dart'; import 'package:flutter/material.dart'; import 'package:app/back_button.dart'; import 'package:app/client.dart'; -import "package:intl/intl.dart"; class Payments extends StatelessWidget { @override @@ -81,7 +79,7 @@ class _PaymentsPageState extends State { } void openPayment(id) { - Navigator.pushNamed(context, '/payments/$id'); + Navigator.pushNamed(context, 'payments/$id'); } List _InvoiceList() { diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index e733b09f..10bbb923 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -54,7 +54,7 @@ class _SetCurrencyPageState extends State { if (Navigator.canPop(context)) Navigator.pop(context, true); else - Navigator.pushNamedAndRemoveUntil(context, '/settings', (Route route) => false); + Navigator.pushNamedAndRemoveUntil(context, 'settings', (Route route) => false); } void _filterList(text) { diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index ddf799c8..3e5693b1 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -93,7 +93,7 @@ class _SettingsPageState extends State { ], ), onTap: () { - Navigator.pushNamed(context, '/settings/addresses').then((value) { + Navigator.pushNamed(context, 'settings/addresses').then((value) { _successMessage = ''; _rebuild(); }); @@ -128,7 +128,7 @@ class _SettingsPageState extends State { ], ), onTap: () { - Navigator.pushNamed(context, '/settings/currency').then((value) { + Navigator.pushNamed(context, 'settings/currency').then((value) { _successMessage = 'Saved!'; _rebuild(); }); @@ -155,7 +155,7 @@ class _SettingsPageState extends State { ], ), onTap: () { - Navigator.pushNamed(context, '/settings/business-info'); + Navigator.pushNamed(context, 'settings/business-info'); } ), ); From db89ef564ad0380dfe29faed8669c7b831be1ff1 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 22:06:04 +0400 Subject: [PATCH 14/57] Cleanup main.dart --- lib/main.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index ab8032d2..89d94b15 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -56,8 +56,12 @@ class Anypay extends StatelessWidget { return MaterialApp( builder: (BuildContext context, Widget? child) { + if (child == null) { + throw 'MaterialApp builder child is null'; + } + return SafeArea( - child: child!, + child: child, ); }, initialRoute: isAuthenticated ? 'new-invoice' : 'login', From d68168d5b3ec5ffa7c6af5aab1c5ab892325850a Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 22:06:38 +0400 Subject: [PATCH 15/57] Cleanup main.dart --- lib/main.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 89d94b15..d82a072b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,11 +27,11 @@ class Anypay extends StatelessWidget { var lightTheme = ThemeData( primaryColorDark: Color(0xFF707070), primaryColorLight: Color(0xFF404040), - brightness: Brightness.light, colorScheme: ColorScheme.fromSwatch().copyWith( background: AppController.white, secondary: AppController.blue, - brightness: Brightness.light), + brightness: Brightness.light + ), fontFamily: 'Ubuntu', ); @@ -41,8 +41,8 @@ class Anypay extends StatelessWidget { colorScheme: ColorScheme.fromSwatch().copyWith( background: Color(0xff222222), secondary: Color(0xff2196f3), - brightness: Brightness.dark), - brightness: Brightness.dark, + brightness: Brightness.dark + ), fontFamily: 'Ubuntu', ); From 391222d4243118a314b6ad634763220f0b69efdd Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 8 Feb 2024 22:22:49 +0400 Subject: [PATCH 16/57] Cleanup account.dart --- lib/models/account.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/models/account.dart b/lib/models/account.dart index a850bd01..3807eccb 100644 --- a/lib/models/account.dart +++ b/lib/models/account.dart @@ -1,4 +1,3 @@ -import 'package:app/currencies.dart'; import 'package:app/models/address.dart'; import 'dart:convert'; @@ -44,13 +43,13 @@ class Account { 'business_name': businessName, 'denomination': denomination, 'email': email, - } as Map; + }; } factory Account.fromMap(Map body) { var json = body['account'] ?? body; + return Account( - ambassadorEmail: json['ambassador_email'], physicalAddress: json['physical_address'], businessName: json['business_name'], denomination: json['denomination'], From df6729d2469e920cfa9a117c566769d075b4b7b2 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 15 Feb 2024 20:54:51 +0300 Subject: [PATCH 17/57] Implement CoinCode to track coins instead of string --- lib/authentication.dart | 6 ++- lib/coins.dart | 29 +++++++++++++- lib/models/account.dart | 26 ++++++++----- lib/preloader.dart | 2 +- lib/routes/addresses.dart | 16 ++++---- lib/routes/invoice.dart | 78 +++++++++++++++++++------------------ lib/routes/new_address.dart | 34 +++++++--------- 7 files changed, 109 insertions(+), 82 deletions(-) diff --git a/lib/authentication.dart b/lib/authentication.dart index f5d0b453..ece7b68f 100644 --- a/lib/authentication.dart +++ b/lib/authentication.dart @@ -67,13 +67,15 @@ class Authentication { var coins = response['body']['coins'] ?? []; Coins.all = {}; coins.forEach((coin) { - Coins.all[coin['code']] = { + var coinCode = CoinCode.fromString("${coin['code']}_${coin['chain']}"); + + Coins.all[coinCode] = { 'name': coin['name'], 'decimals': coin['decimals'], 'icon': coin['icon'] }; if (coin['supported'] == true) - Coins.supported[coin['code']] = { + Coins.supported[coinCode] = { 'name': coin['name'], 'icon': coin['icon'], 'decimals': coin['decimals'], diff --git a/lib/coins.dart b/lib/coins.dart index 38fc7eca..571c0677 100644 --- a/lib/coins.dart +++ b/lib/coins.dart @@ -1,4 +1,29 @@ class Coins { - static Map all = {}; - static Map supported = {}; + + static Map all = {}; + static Map supported = {}; +} + +class CoinCode { + String code; + String chain; + + CoinCode(this.code, this.chain); + + @override + int get hashCode => Object.hash(code, chain); + + @override + bool operator ==(Object other) { + return other is CoinCode && + other.code == code && + other.chain == chain; + } + + factory CoinCode.fromString(String code) { + var coinCode = code.contains('_') ? code.split('_')[0] : code; + var coinChain = code.contains('_') ? code.split('_')[1] : code; + + return CoinCode(coinCode, coinChain); + } } diff --git a/lib/models/account.dart b/lib/models/account.dart index 3807eccb..ba441818 100644 --- a/lib/models/account.dart +++ b/lib/models/account.dart @@ -1,10 +1,10 @@ +import 'package:app/coins.dart'; import 'package:app/models/address.dart'; import 'dart:convert'; class Account { - Map addresses = {}; + Map addresses = {}; bool fetchingCoins = false; - String? ambassadorEmail; String? physicalAddress; String? businessName; String? denomination; @@ -13,7 +13,6 @@ class Account { List coins = []; Account({ - this.ambassadorEmail, this.physicalAddress, this.businessName, this.denomination, @@ -24,21 +23,28 @@ class Account { return jsonEncode(toMap()); } - Address? addressFor(code) { - return addresses[code] ?? null; + Address? addressFor(CoinCode coinCode) { + return addresses[coinCode]; } String? get preferredCoinCode { - if (coins.length == 0) return null; - var codes = coins.map((a) => a['code']); - if (codes.contains('BSV')) + if (coins.length == 0) { + return null; + }; + + var codes = coins.map((coin) => coin['code']); + + if (codes.contains('BSV')) { return 'BSV'; - else return codes.first; + } + + else { + return codes.first; + }; } Map toMap() { return { - 'ambassador_email': ambassadorEmail, 'physical_address': physicalAddress, 'business_name': businessName, 'denomination': denomination, diff --git a/lib/preloader.dart b/lib/preloader.dart index 178e1a04..028979c3 100644 --- a/lib/preloader.dart +++ b/lib/preloader.dart @@ -12,7 +12,7 @@ class Preloader { downloadStarted = true; var context = AppController.getCurrentContext(); - Coins.all.forEach((code, details) { + Coins.all.forEach((CoinCode coinCode, details) { var configuration = createLocalImageConfiguration(context); NetworkImage(details['icon'])..resolve(configuration); }); diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index 93c13c1b..eb29dadc 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -41,7 +41,7 @@ class _AddressesPageState extends State { ..._newAddressLinks(), CircleBackButton( margin: EdgeInsets.only(top: 20.0), - backPath: '/settings', + backPath: 'settings', ), ] ), @@ -55,18 +55,18 @@ class _AddressesPageState extends State { if (Coins.all.length == 0) return [SpinKitCircle(color: AppController.blue)]; else { - var coinList = Coins.supported.keys.toList(); + List coinList = Coins.supported.keys.toList(); - coinList.sort(); + coinList.sort((a, b) => a.code.compareTo(b.code)); - return coinList.map((code) => + return coinList.map((coinCode) => Container( height: 100, width: 400, child: GestureDetector( behavior: HitTestBehavior.translucent, - onTap: () => { - Navigator.pushNamed(context, 'new-address/$code') + onTap: () { + Navigator.pushNamed(context, 'new-address/${coinCode.code}/${coinCode.chain}'); }, child: Row( children: [ @@ -79,12 +79,12 @@ class _AddressesPageState extends State { bottom: 10.0, ), child: Image.network( - Coins.supported[code]['icon'] + Coins.supported[coinCode]['icon'] ), ), Expanded( child: Text( - Coins.supported[code]['name'], + Coins.supported[coinCode]['name'], style: TextStyle(fontSize: 22), maxLines: 2, overflow: TextOverflow.fade diff --git a/lib/routes/invoice.dart b/lib/routes/invoice.dart index 21b51e38..d49ecc91 100644 --- a/lib/routes/invoice.dart +++ b/lib/routes/invoice.dart @@ -55,7 +55,7 @@ class _InvoicePageState extends State { Timer? periodicRequest; String? _errorMessage; String? notesError; - String? currency; + CoinCode? currency; Color? qrColor; String? uri; String? id; @@ -63,18 +63,6 @@ class _InvoicePageState extends State { Invoice? invoice; RectGetter? sharePlacement; - Map? get bsvPaymentOption => invoice != null ? invoice!.bsvPaymentOption : null; - List get embedOutputs { - if (bsvPaymentOption == null) return []; - return (bsvPaymentOption!['outputs'] ?? []).map((output) { - var _output = {}; - _output['amount'] = output['amount']/100000000; - _output['to'] = output['address']; - _output['currency'] = 'BSV'; - return _output; - }).toList(); - } - Map? arguments; Merchant? merchant; @@ -206,7 +194,9 @@ class _InvoicePageState extends State { void _rebuild() { setState(() { - currency = currency ?? invoice?.currency; + var invoiceCurrency = invoice != null ? CoinCode.fromString( + invoice!.currency!) : null; + currency = currency ?? invoiceCurrency; uri = invoice?.uriFor(currency, format: getFormat()); }); if (invoice != null && _invoiceReady == false) { @@ -257,7 +247,7 @@ class _InvoicePageState extends State { width: 300, child: GestureDetector( behavior: HitTestBehavior.translucent, - child: _PaymentTitle('anypay'), + child: _PaymentTitle(CoinCode('anypay', 'anypay')), onTap: () { choosingCurrency = false; usePayProtocol = true; @@ -266,15 +256,16 @@ class _InvoicePageState extends State { ) ), ...(invoice!.paymentOptions!.map((option) { - var code = option['chain'] != option['currency'] ? option['currency'] + '_' + option['chain'] : option['currency']; + var coinCode = CoinCode.fromString( + "${option['currency']}_${option['chain']}"); return Container( width: 300, margin: EdgeInsets.only(top: 10), child: GestureDetector( behavior: HitTestBehavior.translucent, - child: _PaymentTitle(code, paymentOption: option), + child: _PaymentTitle(coinCode, paymentOption: option), onTap: () { - currency = code; + currency = coinCode; chosenPaymentOption = option; choosingCurrency = false; usePayProtocol = false; @@ -522,16 +513,16 @@ class _InvoicePageState extends State { ); } - Widget _PaymentTitle(currency, {paymentOption}) { + Widget _PaymentTitle(CoinCode currency, {paymentOption}) { paymentOption = paymentOption ?? chosenPaymentOption; var coinDetailsSpecified = paymentOption != null; var coinIsSupported = Coins.supported[currency] != null; paymentOption = paymentOption ?? {}; - if (currency == 'anypay' || coinIsSupported || coinDetailsSpecified) + if (currency.code == 'anypay' || coinIsSupported || coinDetailsSpecified) { return Container( child: Row( - children: currency == 'anypay' ? [ + children: currency.code == 'anypay' ? [ Container( width: 60, child: Image( @@ -546,15 +537,18 @@ class _InvoicePageState extends State { width: 40, height: 40, margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 15, bottom: 15), - child: Image.network(paymentOption['currency_logo_url'] ?? Coins.supported[currency]['icon']), + child: Image.network(paymentOption['currency_logo_url'] ?? + Coins.supported[currency]['icon']), ), - Text(paymentOption['currency_name'] ?? Coins.supported[currency]['name'], + Text(paymentOption['currency_name'] ?? + Coins.supported[currency]['name'], style: TextStyle(fontSize: 40), - ), - ] - ) - ); - else return Container(); + ), + ] + )); + } else { + return Container(); + } } bool _showInvoice() { @@ -588,9 +582,9 @@ class _InvoicePageState extends State { Widget _InvoiceComponent() { return AnimatedOpacity( - opacity: _invoiceReady ? 1.0 : 0.0, - duration: Duration(milliseconds: 300), - child: Column( + opacity: _invoiceReady ? 1.0 : 0.0, + duration: Duration(milliseconds: 300), + child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Text(_successMessage, @@ -612,9 +606,12 @@ class _InvoicePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - _PaymentTitle(usePayProtocol ? 'anypay' : currency), + _PaymentTitle(usePayProtocol + ? CoinCode('anypay', 'anypay') + : currency!), Visibility( - visible: invoice != null && invoice!.paymentOptions != null && + visible: invoice != null && + invoice!.paymentOptions != null && invoice!.paymentOptions!.length > 1, child: Container( width: 40, @@ -644,7 +641,8 @@ class _InvoicePageState extends State { child: QrImageView( foregroundColor: Color(0xFF404040), version: QrVersions.auto, - size: AppController.scale(200, maxValue: 280, minValue: 100), + size: AppController.scale( + 200, maxValue: 280, minValue: 100), data: uri!, ), ), @@ -670,7 +668,8 @@ class _InvoicePageState extends State { padding: EdgeInsets.only(left: 15), child: Image( image: AppController.enableDarkMode ? - AssetImage('assets/images/share-white.png') : + AssetImage( + 'assets/images/share-white.png') : AssetImage('assets/images/share.png'), width: 20, ) @@ -694,7 +693,7 @@ class _InvoicePageState extends State { ) ) ] - ) + ) ); } @@ -706,9 +705,12 @@ class _InvoicePageState extends State { _rebuild(); }; return Visibility( - visible: invoice == null || (!invoice!.isExpired() && invoice!.isUnpaid()) || invoice!.isUnderpaid(), + visible: invoice == null || + (!invoice!.isExpired() && invoice!.isUnpaid()) || + invoice!.isUnderpaid(), child: CircleBackButton( - margin: margin ?? EdgeInsets.only(top: AppController.scale(15.0), bottom: 20.0), + margin: margin ?? + EdgeInsets.only(top: AppController.scale(15.0), bottom: 20.0), backPath: backPath, opaque: false, onTap: onTap, diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index f714b661..51488bab 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -11,29 +11,33 @@ import 'package:app/coins.dart'; import 'dart:async'; class NewAddress extends StatelessWidget { - NewAddress(this.code); + NewAddress(this.code, this.chain); final String code; + final String chain; @override Widget build(BuildContext context) { - return NewAddressPage(code: code); + return NewAddressPage(code: code, chain: chain); } } class NewAddressPage extends StatefulWidget { - NewAddressPage({Key? key, required this.code}) : super(key: key); + NewAddressPage({Key? key, required this.code, required this.chain}) + : super(key: key); final String code; + final String chain; @override - _NewAddressPageState createState() => _NewAddressPageState(code); + _NewAddressPageState createState() => _NewAddressPageState(code, chain); } class _NewAddressPageState extends State { - _NewAddressPageState(this.code); + _NewAddressPageState(this.code, this.chain); final String code; + final String chain; bool _scanning = false; bool _submittingScan = false; @@ -68,7 +72,7 @@ class _NewAddressPageState extends State { ), CircleBackButton( margin: EdgeInsets.only(top: 20.0), - backPath: '/settings', + backPath: 'settings', ) ]) : SingleChildScrollView( @@ -111,7 +115,7 @@ class _NewAddressPageState extends State { ), CircleBackButton( margin: EdgeInsets.only(top: 20.0), - backPath: '/settings', + backPath: 'settings', ), ], ), @@ -124,7 +128,7 @@ class _NewAddressPageState extends State { void _rebuild() { if (!_disposed) setState(() { - _address = Authentication.currentAccount.addressFor(this.code); + _address = Authentication.currentAccount.addressFor(CoinCode(this.code, this.chain)); _note = _address?.note ?? ""; _message = _address?.toString() ?? ""; _messageType = 'success'; @@ -183,19 +187,7 @@ class _NewAddressPageState extends State { _message = address; }); - var coinCode, coinChain; - - var coinCodename = code.split('_'); - - coinCode = coinCodename[0]; - - if (coinCodename.length == 1) { - coinChain = coinCode; - } else { - coinChain = coinCodename[1]; - } - - Client.setAddress(coinCode, coinChain, address).then((response) { + Client.setAddress(code, chain, address).then((response) { if (!_disposed) setState(() { _submittingScan = false; From fb8eb5fb8116d8370e1c1c89cef12e4c601f9b99 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 15 Feb 2024 20:55:10 +0300 Subject: [PATCH 18/57] Remove unused bsvPaymentOption --- lib/models/invoice.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/models/invoice.dart b/lib/models/invoice.dart index aa07a5b1..1834fd3c 100644 --- a/lib/models/invoice.dart +++ b/lib/models/invoice.dart @@ -129,10 +129,6 @@ class Invoice { return expiry != null && expiry!.isBefore(DateTime.now()); } - Map get bsvPaymentOption { - return paymentOptions?.firstWhere((option) => option['currency'] == 'BSV', orElse: () => null); - } - String urlStyleUri([useCurrency]) { useCurrency = useCurrency ?? currency; String host = Client.host; From 6ea1bde1e48e3c26fa88ba3bd8233c7fee2e62cf Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 15 Feb 2024 20:55:57 +0300 Subject: [PATCH 19/57] Fix router to support two query params --- lib/router.dart | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/lib/router.dart b/lib/router.dart index d18fc403..9fd10076 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -18,87 +18,95 @@ import 'package:app/routes/login.dart'; class AnyFluroRouter { static FluroRouter router = FluroRouter(); - static newHandler(klass, [key]) { - return Handler(handlerFunc: (BuildContext? context, Map params) { - if (key == null) return klass(); - else return klass(params[key][0]); + static newHandler(klass, List keys) { + return Handler( + handlerFunc: (BuildContext? context, Map params) { + var klassParams = keys.map((key) => params[key][0].toString()).toList(); + + if (klassParams.length == 0) { + return klass(); + } else if(klassParams.length == 1) { + return klass(klassParams[0]); + } else { + return klass(klassParams[0], klassParams[1]); + } }); } static void setupRouter() { router.define( 'login', - handler: newHandler(() => Login()), + handler: newHandler(() => Login(), []), transitionType: TransitionType.fadeIn, ); router.define( 'registration', - handler: newHandler(() => CreateAccount()), + handler: newHandler(() => CreateAccount(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'register-business', - handler: newHandler(() => EditBusinessInfo(allowBack: false)), + handler: newHandler(() => EditBusinessInfo(allowBack: false), []), transitionType: TransitionType.inFromBottom, ); router.define( 'password-reset', - handler: newHandler(() => ForgotPassword()), + handler: newHandler(() => ForgotPassword(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'invoices/:id', - handler: newHandler((id) => ShowInvoice(id), 'id'), + handler: newHandler((id) => ShowInvoice(id), ['id']), transitionType: TransitionType.inFromBottom, ); router.define( 'new-invoice', - handler: newHandler(() => NewInvoice()), + handler: newHandler(() => NewInvoice(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'navigation', - handler: newHandler(() => Navigation()), + handler: newHandler(() => Navigation(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'settings', - handler: newHandler(() => Settings()), + handler: newHandler(() => Settings(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'settings/business-info', - handler: newHandler(() => EditBusinessInfo()), + handler: newHandler(() => EditBusinessInfo(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'settings/currency', - handler: newHandler(() => SetCurrency()), + handler: newHandler(() => SetCurrency(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'settings/addresses', - handler: newHandler(() => Addresses()), + handler: newHandler(() => Addresses(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'payments', - handler: newHandler(() => Payments()), + handler: newHandler(() => Payments(), []), transitionType: TransitionType.inFromBottom, ); router.define( 'payments/:id', - handler: newHandler((id) => Payment(id), 'id'), + handler: newHandler((id) => Payment(id), ['id']), transitionType: TransitionType.inFromBottom, ); router.define( 'pay/:id', - handler: newHandler((id) => NewInvoice(merchantId: id), 'id'), + handler: newHandler((id) => NewInvoice(merchantId: id), ['id']), transitionType: TransitionType.inFromBottom, ); router.define( - 'new-address/:code', - handler: newHandler((code) => NewAddress(code), 'code'), + 'new-address/:code/:chain', + handler: newHandler((code, chain) => NewAddress(code, chain), ['code', 'chain']), transitionType: TransitionType.inFromBottom, ); } From 8bac6863df6bd9f63b07368a833402306d5f7453 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 15 Feb 2024 20:56:24 +0300 Subject: [PATCH 20/57] Remove slash from backPath navigation --- lib/routes/create_account.dart | 2 +- lib/routes/forgot_password.dart | 2 +- lib/routes/navigation.dart | 2 +- lib/routes/payment.dart | 2 +- lib/routes/payments.dart | 2 +- lib/routes/set_currency.dart | 2 +- lib/routes/settings.dart | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/routes/create_account.dart b/lib/routes/create_account.dart index 4a69bbdb..64e3a2f8 100644 --- a/lib/routes/create_account.dart +++ b/lib/routes/create_account.dart @@ -61,7 +61,7 @@ class _CreateAccountPageState extends State { ), ), CircleBackButton( - backPath: '/login', + backPath: 'login', ), ], ), diff --git a/lib/routes/forgot_password.dart b/lib/routes/forgot_password.dart index 474b3842..bd47acc9 100644 --- a/lib/routes/forgot_password.dart +++ b/lib/routes/forgot_password.dart @@ -118,7 +118,7 @@ class _ForgotPasswordPageState extends State { ), ), CircleBackButton( - backPath: '/login', + backPath: 'login', ), ], ), diff --git a/lib/routes/navigation.dart b/lib/routes/navigation.dart index 10f72f99..be51fc71 100644 --- a/lib/routes/navigation.dart +++ b/lib/routes/navigation.dart @@ -39,7 +39,7 @@ class _NavigationPageState extends State { ..._Links(), CircleBackButton( margin: EdgeInsets.all(AppController.scale(20.0)), - backPath: '/new-invoice', + backPath: 'new-invoice', ), ], ) diff --git a/lib/routes/payment.dart b/lib/routes/payment.dart index 2949e2f8..c86a0207 100644 --- a/lib/routes/payment.dart +++ b/lib/routes/payment.dart @@ -45,7 +45,7 @@ class _PaymentPageState extends State { alignment: Alignment(-0.83, -1), child: CircleBackButton( margin: EdgeInsets.only(right: 20.0, top: 35 + AppController.topPadding()), - backPath: '/payments', + backPath: 'payments', ) ) ), diff --git a/lib/routes/payments.dart b/lib/routes/payments.dart index 2bcb835c..3a10c690 100644 --- a/lib/routes/payments.dart +++ b/lib/routes/payments.dart @@ -34,7 +34,7 @@ class _PaymentsPageState extends State { child: SafeArea( child: CircleBackButton( margin: EdgeInsets.only(right: 20.0, top: 35 + AppController.topPadding()), - backPath: '/navigation', + backPath: 'navigation', ) ) ) diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index 10bbb923..c7bd2390 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -77,7 +77,7 @@ class _SetCurrencyPageState extends State { margin: EdgeInsets.only(top: 10.0, left: 10.0), child: (_chosenCurrency == null ? CircleBackButton( - backPath: '/navigation', + backPath: 'navigation', ) : SpinKitCircle(color: AppController.randomColor) ) ), diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index 3e5693b1..6942f9e1 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -56,7 +56,7 @@ class _SettingsPageState extends State { _AddressesLink(context), CircleBackButton( margin: EdgeInsets.only(top: 20.0), - backPath: '/navigation', + backPath: 'navigation', ), ], ) From dbb8391fe59d76554e756b18c042f8bccb1ae649 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 15 Feb 2024 20:56:48 +0300 Subject: [PATCH 21/57] Remove ambassadorEmail --- lib/routes/edit_business_info.dart | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index b1a9add4..138418b5 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -1,4 +1,3 @@ -import 'package:email_validator/email_validator.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:app/authentication.dart'; import 'package:app/app_controller.dart'; @@ -72,7 +71,6 @@ class _EditBusinessInfoPageState extends State { void _rebuild() { setState(() { address.text = Authentication.currentAccount.physicalAddress ?? 'N\\A'; - email.text = Authentication.currentAccount.ambassadorEmail?? 'N\\A'; name.text = Authentication.currentAccount.businessName?? 'N\\A'; }); } @@ -95,7 +93,6 @@ class _EditBusinessInfoPageState extends State { _closeKeyboard(); if (_formKey.currentState != null && _formKey.currentState!.validate()) { Authentication.updateAccount({ - 'ambassador_email': email.text.toLowerCase(), 'physical_address': address.text, 'business_name': name.text, }).then((response) { @@ -140,17 +137,6 @@ class _EditBusinessInfoPageState extends State { labelText: 'Business Street Address (Optional)' ), ), - TextFormField( - controller: email, - decoration: InputDecoration( - labelText: 'Ambassador Email (Optional)' - ), - validator: (value) { - if (value != null && !value.isEmpty && !EmailValidator.validate(value.trim())) - return "That doesn't look like an email address"; - return null; - }, - ), Container( margin: EdgeInsets.only(top: 40.0), child: _submitting ? SpinKitCircle(color: AppController.randomColor) : GestureDetector( @@ -164,7 +150,7 @@ class _EditBusinessInfoPageState extends State { ), !allowBack ? Container() : CircleBackButton( margin: EdgeInsets.only(top: 20.0), - backPath: '/settings', + backPath: 'settings', ) ], ), From f88b2e4a9b589964762f61c3139094220a46edf4 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 16 Feb 2024 20:27:58 +0300 Subject: [PATCH 22/57] Migrate to CoinCode --- lib/authentication.dart | 2 +- lib/routes/new_address.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/authentication.dart b/lib/authentication.dart index ece7b68f..b275cc4f 100644 --- a/lib/authentication.dart +++ b/lib/authentication.dart @@ -89,7 +89,7 @@ class Authentication { await Client.fetchAccountAddresses().then((response) { response['body']['addresses'].forEach((address) { - currentAccount.addresses[address['currency'] + '_' + address['chain']] = Address.fromMap(address); + currentAccount.addresses[CoinCode(address['currency'], address['chain'])] = Address.fromMap(address); }); }); } diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index 51488bab..96de4f66 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -243,11 +243,11 @@ class _NewAddressPageState extends State { bottom: 10.0, ), child: Image.network( - Coins.all[code]['icon'] + Coins.all[CoinCode(code, chain)]['icon'] ), ), Text( - Coins.all[code]['name'], + Coins.all[CoinCode(code, chain)]['name'], style: TextStyle( fontSize: 30, ), From fa4fc8d7a9107cfdd83ced0c60282c5bcb1398a7 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 16 Feb 2024 21:52:24 +0300 Subject: [PATCH 23/57] Apply theme text color to all text labels --- lib/routes/addresses.dart | 5 ++++- lib/routes/edit_business_info.dart | 6 ++++++ lib/routes/new_address.dart | 5 ++++- lib/routes/new_invoice.dart | 1 + lib/routes/payments.dart | 1 + lib/routes/settings.dart | 4 ++++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index eb29dadc..11522346 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -85,7 +85,10 @@ class _AddressesPageState extends State { Expanded( child: Text( Coins.supported[coinCode]['name'], - style: TextStyle(fontSize: 22), + style: TextStyle( + fontSize: 22, + color: Theme.of(context).primaryColorLight + ), maxLines: 2, overflow: TextOverflow.fade ), diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index 138418b5..362f3b2e 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -128,12 +128,18 @@ class _EditBusinessInfoPageState extends State { TextFormField( controller: name, decoration: InputDecoration( + labelStyle: TextStyle( + color: Theme.of(context).primaryColorLight + ), labelText: 'Business Name (Optional)' ), ), TextFormField( controller: address, decoration: InputDecoration( + labelStyle: TextStyle( + color: Theme.of(context).primaryColorLight + ), labelText: 'Business Street Address (Optional)' ), ), diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index 96de4f66..1781e4b3 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -249,7 +249,8 @@ class _NewAddressPageState extends State { Text( Coins.all[CoinCode(code, chain)]['name'], style: TextStyle( - fontSize: 30, + fontSize: 50, + color: Theme.of(context).primaryColorLight ), ) ] @@ -280,6 +281,7 @@ class _NewAddressPageState extends State { child: Text('Scan', style: TextStyle( fontSize: 50, + color: Theme.of(context).primaryColorLight ), ) ), @@ -309,6 +311,7 @@ class _NewAddressPageState extends State { Text('Paste', style: TextStyle( fontSize: 50, + color: Theme.of(context).primaryColorLight ), ) ], diff --git a/lib/routes/new_invoice.dart b/lib/routes/new_invoice.dart index f84e67f6..35c7f5ca 100644 --- a/lib/routes/new_invoice.dart +++ b/lib/routes/new_invoice.dart @@ -180,6 +180,7 @@ class _NewInvoicePageState extends State { child: Text( _price > 0 ? '$_visiblePrice' : "", style: TextStyle( + color: Theme.of(context).primaryColorLight, fontSize: (40 - 1.5*max(_visiblePrice.length-8, 0)).toDouble(), ) ), diff --git a/lib/routes/payments.dart b/lib/routes/payments.dart index 3a10c690..51cb982d 100644 --- a/lib/routes/payments.dart +++ b/lib/routes/payments.dart @@ -187,6 +187,7 @@ class _PaymentsPageState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Payments', style: TextStyle( + color: Theme.of(context).primaryColorLight, fontWeight: FontWeight.bold, fontSize: 40, )), diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index 6942f9e1..5c57dc78 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -87,6 +87,7 @@ class _SettingsPageState extends State { margin: EdgeInsets.all(AppController.scale(20.0)), child: Text("Addresses", style: TextStyle( fontSize: 22, + color: Theme.of(context).primaryColorLight )) ), Icon(Icons.edit), @@ -116,10 +117,12 @@ class _SettingsPageState extends State { children: [ Text("Currency ", style: TextStyle( fontSize: 22, + color: Theme.of(context).primaryColorLight )), Text("($symbol$denomination)", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 22, + color: Theme.of(context).primaryColorLight )), ], ) @@ -149,6 +152,7 @@ class _SettingsPageState extends State { margin: EdgeInsets.all(AppController.scale(20.0)), child: Text("Business Info", style: TextStyle( fontSize: 22, + color: Theme.of(context).primaryColorLight )), ), Icon(Icons.edit), From 7fe9ea90553b336290b2346f5fd375d69990022b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 16 Feb 2024 21:52:45 +0300 Subject: [PATCH 24/57] Fix payment route (migrate to coincode) --- lib/routes/payment.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/routes/payment.dart b/lib/routes/payment.dart index c86a0207..36a5d83d 100644 --- a/lib/routes/payment.dart +++ b/lib/routes/payment.dart @@ -36,6 +36,7 @@ class _PaymentPageState extends State { String _errorMessage = ''; Invoice? _payment; String? _notes; + CoinCode? coinCode; @override Widget build(BuildContext context) { @@ -64,6 +65,8 @@ class _PaymentPageState extends State { setState(() { if (response['success']) { _payment = response['invoice']; + var paymentOption = _payment!.paymentOptionFor(_payment!.currency); + coinCode = CoinCode(paymentOption['currency'], paymentOption['chain']); if (_payment != null) { _notes = _payment!.orderNotes(); } @@ -77,9 +80,9 @@ class _PaymentPageState extends State { return SpinKitCircle(color: AppController.blue); var denominationCurrencyName = - (Coins.all[_payment!.currency] ?? {})['name'] ?? '...'; + (Coins.all[coinCode] ?? {})['name'] ?? '...'; var denominationCurrencyAmount = (_payment!.invoiceAmountPaid != null - ? (_payment!.invoiceAmountPaid! / pow(10, Coins.all[_payment!.currency]['decimals'])).toString() + ? (_payment!.invoiceAmountPaid! / pow(10, Coins.all[coinCode]['decimals'])).toString() : '...'); var denominationCurrencyText = denominationCurrencyName + ' ' + denominationCurrencyAmount; From 939314f4bd159ce89c4944a7a60911c5ebd45290 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Fri, 16 Feb 2024 21:53:21 +0300 Subject: [PATCH 25/57] Remove web import --- lib/routes/payment.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/routes/payment.dart b/lib/routes/payment.dart index 36a5d83d..edd6152e 100644 --- a/lib/routes/payment.dart +++ b/lib/routes/payment.dart @@ -1,5 +1,4 @@ -import 'package:url_launcher/url_launcher.dart' - if (dart.library.html) 'package:app/web_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:app/app_controller.dart'; import 'package:app/models/invoice.dart'; From c76565c39cdf22980428beaceb8a8061c209d581 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Sat, 17 Feb 2024 03:19:35 +0300 Subject: [PATCH 26/57] Fix scan button --- lib/routes/new_address.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index 1781e4b3..a4c515b9 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -162,6 +162,7 @@ class _NewAddressPageState extends State { void _scanAddress() async { _scanning = true; + _rebuild(); } void _setNote() async { From bb2d391608701590d2fd97c51523b0385afeb49a Mon Sep 17 00:00:00 2001 From: pshenmic Date: Sat, 17 Feb 2024 03:20:03 +0300 Subject: [PATCH 27/57] Fix colors for edit business info and set currency --- lib/routes/edit_business_info.dart | 6 ++++++ lib/routes/set_currency.dart | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index 362f3b2e..cd12190c 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -127,6 +127,9 @@ class _EditBusinessInfoPageState extends State { ), TextFormField( controller: name, + style: TextStyle( + color: Theme.of(context).primaryColorLight + ), decoration: InputDecoration( labelStyle: TextStyle( color: Theme.of(context).primaryColorLight @@ -136,6 +139,9 @@ class _EditBusinessInfoPageState extends State { ), TextFormField( controller: address, + style: TextStyle( + color: Theme.of(context).primaryColorLight + ), decoration: InputDecoration( labelStyle: TextStyle( color: Theme.of(context).primaryColorLight diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index c7bd2390..d1331213 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -86,8 +86,14 @@ class _SetCurrencyPageState extends State { margin: EdgeInsets.only(top: 0.0, bottom: 10.0), padding: EdgeInsets.all(10.0), child: TextField( + style: TextStyle( + color: Theme.of(context).primaryColorLight + ), decoration: InputDecoration( - labelText: 'Search Currencies' + labelText: 'Search Currencies', + labelStyle: TextStyle( + color: Theme.of(context).primaryColorLight + ), ), onChanged: (text) { _filterList(text); @@ -126,6 +132,7 @@ class _SetCurrencyPageState extends State { child: Text(display.join(' - '), textAlign: TextAlign.center, style: TextStyle( + color: Theme.of(context).primaryColorLight, fontWeight: FontWeight.bold, fontSize: 18, ), From 85c9b76295047c69980cdc0ac90eccdd2694786a Mon Sep 17 00:00:00 2001 From: pshenmic Date: Sat, 17 Feb 2024 03:20:29 +0300 Subject: [PATCH 28/57] Refactor coincode --- lib/routes/invoice.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/routes/invoice.dart b/lib/routes/invoice.dart index d49ecc91..b24645d1 100644 --- a/lib/routes/invoice.dart +++ b/lib/routes/invoice.dart @@ -256,8 +256,7 @@ class _InvoicePageState extends State { ) ), ...(invoice!.paymentOptions!.map((option) { - var coinCode = CoinCode.fromString( - "${option['currency']}_${option['chain']}"); + var coinCode = CoinCode(option['currency'], option['chain']); return Container( width: 300, margin: EdgeInsets.only(top: 10), @@ -530,7 +529,9 @@ class _InvoicePageState extends State { ), ), Text('Anypay', - style: TextStyle(fontSize: 35), + style: TextStyle(fontSize: 35, + color: Theme.of(context).primaryColorLight, + ), ), ] : [ Container( @@ -542,9 +543,11 @@ class _InvoicePageState extends State { ), Text(paymentOption['currency_name'] ?? Coins.supported[currency]['name'], - style: TextStyle(fontSize: 40), - ), - ] + style: TextStyle(fontSize: 40, + color: Theme.of(context).primaryColorLight, + ), + ), + ] )); } else { return Container(); @@ -661,6 +664,7 @@ class _InvoicePageState extends State { Text('Share Payment Request', style: TextStyle( fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColorLight, fontSize: 13, ) ), From 89d4f49d41dcebbbcdf013f302e81e0c779b264a Mon Sep 17 00:00:00 2001 From: pshenmic Date: Sat, 17 Feb 2024 04:04:27 +0300 Subject: [PATCH 29/57] Fix styles at login page --- lib/routes/login.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 68301c8b..5ac939b6 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -103,8 +103,14 @@ class _LoginPageState extends State { TextFormField( autofillHints: [AutofillHints.username], controller: email, + style: TextStyle( + color: Theme.of(context).primaryColorLight + ), decoration: InputDecoration( - labelText: 'Email' + labelText: 'Email', + labelStyle: TextStyle( + color: Theme.of(context).primaryColorLight + ) ), validator: (value) { if (value != null && value.isEmpty) return 'Please enter some text'; @@ -119,8 +125,14 @@ class _LoginPageState extends State { TextFormField( obscureText: true, controller: password, + style: TextStyle( + color: Theme.of(context).primaryColorLight + ), decoration: InputDecoration( labelText: 'Password', + labelStyle: TextStyle( + color: Theme.of(context).primaryColorLight + ) ), validator: (value) { if (value != null && value.isEmpty) return 'Please enter some text'; From 0970cb51e6d97c1e68c143e4bdc04dc6b003835b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 13:30:36 +0300 Subject: [PATCH 30/57] Revert "Fix styles at login page" This reverts commit 89d4f49d41dcebbbcdf013f302e81e0c779b264a. --- lib/routes/login.dart | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 5ac939b6..68301c8b 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -103,14 +103,8 @@ class _LoginPageState extends State { TextFormField( autofillHints: [AutofillHints.username], controller: email, - style: TextStyle( - color: Theme.of(context).primaryColorLight - ), decoration: InputDecoration( - labelText: 'Email', - labelStyle: TextStyle( - color: Theme.of(context).primaryColorLight - ) + labelText: 'Email' ), validator: (value) { if (value != null && value.isEmpty) return 'Please enter some text'; @@ -125,14 +119,8 @@ class _LoginPageState extends State { TextFormField( obscureText: true, controller: password, - style: TextStyle( - color: Theme.of(context).primaryColorLight - ), decoration: InputDecoration( labelText: 'Password', - labelStyle: TextStyle( - color: Theme.of(context).primaryColorLight - ) ), validator: (value) { if (value != null && value.isEmpty) return 'Please enter some text'; From b089ec16117279e4de5468398eebb84860dd0f2b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 13:30:44 +0300 Subject: [PATCH 31/57] Revert "Fix colors for edit business info and set currency" This reverts commit bb2d391608701590d2fd97c51523b0385afeb49a. --- lib/routes/edit_business_info.dart | 6 ------ lib/routes/set_currency.dart | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index cd12190c..362f3b2e 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -127,9 +127,6 @@ class _EditBusinessInfoPageState extends State { ), TextFormField( controller: name, - style: TextStyle( - color: Theme.of(context).primaryColorLight - ), decoration: InputDecoration( labelStyle: TextStyle( color: Theme.of(context).primaryColorLight @@ -139,9 +136,6 @@ class _EditBusinessInfoPageState extends State { ), TextFormField( controller: address, - style: TextStyle( - color: Theme.of(context).primaryColorLight - ), decoration: InputDecoration( labelStyle: TextStyle( color: Theme.of(context).primaryColorLight diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index d1331213..c7bd2390 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -86,14 +86,8 @@ class _SetCurrencyPageState extends State { margin: EdgeInsets.only(top: 0.0, bottom: 10.0), padding: EdgeInsets.all(10.0), child: TextField( - style: TextStyle( - color: Theme.of(context).primaryColorLight - ), decoration: InputDecoration( - labelText: 'Search Currencies', - labelStyle: TextStyle( - color: Theme.of(context).primaryColorLight - ), + labelText: 'Search Currencies' ), onChanged: (text) { _filterList(text); @@ -132,7 +126,6 @@ class _SetCurrencyPageState extends State { child: Text(display.join(' - '), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).primaryColorLight, fontWeight: FontWeight.bold, fontSize: 18, ), From 0993107326247a450502ce10a91c2a08e221276f Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 13:30:52 +0300 Subject: [PATCH 32/57] Revert "Apply theme text color to all text labels" This reverts commit fa4fc8d7a9107cfdd83ced0c60282c5bcb1398a7. --- lib/routes/addresses.dart | 5 +---- lib/routes/edit_business_info.dart | 6 ------ lib/routes/new_address.dart | 5 +---- lib/routes/new_invoice.dart | 1 - lib/routes/payments.dart | 1 - lib/routes/settings.dart | 4 ---- 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index 11522346..eb29dadc 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -85,10 +85,7 @@ class _AddressesPageState extends State { Expanded( child: Text( Coins.supported[coinCode]['name'], - style: TextStyle( - fontSize: 22, - color: Theme.of(context).primaryColorLight - ), + style: TextStyle(fontSize: 22), maxLines: 2, overflow: TextOverflow.fade ), diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index 362f3b2e..138418b5 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -128,18 +128,12 @@ class _EditBusinessInfoPageState extends State { TextFormField( controller: name, decoration: InputDecoration( - labelStyle: TextStyle( - color: Theme.of(context).primaryColorLight - ), labelText: 'Business Name (Optional)' ), ), TextFormField( controller: address, decoration: InputDecoration( - labelStyle: TextStyle( - color: Theme.of(context).primaryColorLight - ), labelText: 'Business Street Address (Optional)' ), ), diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index a4c515b9..77974c1c 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -250,8 +250,7 @@ class _NewAddressPageState extends State { Text( Coins.all[CoinCode(code, chain)]['name'], style: TextStyle( - fontSize: 50, - color: Theme.of(context).primaryColorLight + fontSize: 30, ), ) ] @@ -282,7 +281,6 @@ class _NewAddressPageState extends State { child: Text('Scan', style: TextStyle( fontSize: 50, - color: Theme.of(context).primaryColorLight ), ) ), @@ -312,7 +310,6 @@ class _NewAddressPageState extends State { Text('Paste', style: TextStyle( fontSize: 50, - color: Theme.of(context).primaryColorLight ), ) ], diff --git a/lib/routes/new_invoice.dart b/lib/routes/new_invoice.dart index 35c7f5ca..f84e67f6 100644 --- a/lib/routes/new_invoice.dart +++ b/lib/routes/new_invoice.dart @@ -180,7 +180,6 @@ class _NewInvoicePageState extends State { child: Text( _price > 0 ? '$_visiblePrice' : "", style: TextStyle( - color: Theme.of(context).primaryColorLight, fontSize: (40 - 1.5*max(_visiblePrice.length-8, 0)).toDouble(), ) ), diff --git a/lib/routes/payments.dart b/lib/routes/payments.dart index 51cb982d..3a10c690 100644 --- a/lib/routes/payments.dart +++ b/lib/routes/payments.dart @@ -187,7 +187,6 @@ class _PaymentsPageState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Payments', style: TextStyle( - color: Theme.of(context).primaryColorLight, fontWeight: FontWeight.bold, fontSize: 40, )), diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index 5c57dc78..6942f9e1 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -87,7 +87,6 @@ class _SettingsPageState extends State { margin: EdgeInsets.all(AppController.scale(20.0)), child: Text("Addresses", style: TextStyle( fontSize: 22, - color: Theme.of(context).primaryColorLight )) ), Icon(Icons.edit), @@ -117,12 +116,10 @@ class _SettingsPageState extends State { children: [ Text("Currency ", style: TextStyle( fontSize: 22, - color: Theme.of(context).primaryColorLight )), Text("($symbol$denomination)", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 22, - color: Theme.of(context).primaryColorLight )), ], ) @@ -152,7 +149,6 @@ class _SettingsPageState extends State { margin: EdgeInsets.all(AppController.scale(20.0)), child: Text("Business Info", style: TextStyle( fontSize: 22, - color: Theme.of(context).primaryColorLight )), ), Icon(Icons.edit), From 1ca4dd28efb20cee5bd6ad534ef52d85014c0f70 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 14:52:29 +0300 Subject: [PATCH 33/57] Add global styles for text and inputs --- lib/main.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index d82a072b..e8920bec 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,6 +27,11 @@ class Anypay extends StatelessWidget { var lightTheme = ThemeData( primaryColorDark: Color(0xFF707070), primaryColorLight: Color(0xFF404040), + inputDecorationTheme: const InputDecorationTheme( + labelStyle: TextStyle(color: Color(0xFF404040)), + enabledBorder: + UnderlineInputBorder(borderSide: BorderSide(color: Colors.black)), + ), colorScheme: ColorScheme.fromSwatch().copyWith( background: AppController.white, secondary: AppController.blue, @@ -38,6 +43,15 @@ class Anypay extends StatelessWidget { var darkTheme = ThemeData( primaryColorDark: Color(0xffCCCCCC), primaryColorLight: Color(0xFFFFFFFF), + textTheme: TextTheme( + bodyMedium: TextStyle(color: Color(0xFFFFFFFF)), + bodyLarge: TextStyle(color: Color(0xFFFFFFFF)), + ), + inputDecorationTheme: const InputDecorationTheme( + labelStyle: TextStyle(color: Color(0xFFFFFFFF)), + enabledBorder: + UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)), + ), colorScheme: ColorScheme.fromSwatch().copyWith( background: Color(0xff222222), secondary: Color(0xff2196f3), From 2add5ecfabf627df476550b8a47ab8d46d24e134 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 14:56:31 +0300 Subject: [PATCH 34/57] Add github action build pipeline --- .github/workflows/build.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..700a9a92 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,19 @@ +name: Build +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.16.5' + channel: 'stable' + - run: flutter build apk From 5e10af136b09f45c92196a665c77ad02e1798424 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 15:08:26 +0300 Subject: [PATCH 35/57] Bump compileSdkVersion --- android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index bd8c449f..621c09ad 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -47,8 +47,8 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "global.anypay.pos" minSdkVersion 21 - compileSdkVersion 33 - targetSdkVersion 33 + compileSdkVersion 34 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } From c7b8cc8a11114d50859fd7a3caa1f65b2168b700 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Mon, 19 Feb 2024 15:16:54 +0300 Subject: [PATCH 36/57] User register for clean task --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index e940e3fe..2a089dde 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,6 +28,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } From 40fd2f983c9f23505638157b941ba4f2faea5903 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:05:54 +0300 Subject: [PATCH 37/57] Install Java 17 --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 700a9a92..7ddf6276 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' - uses: subosito/flutter-action@v2 with: flutter-version: '3.16.5' From fef1b34353c9ab90b9fd4c20b8f46afb3c04a10b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:10:20 +0300 Subject: [PATCH 38/57] Use Oracle Java --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ddf6276..43d18352 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: '17' + distribution: 'oracle' - uses: subosito/flutter-action@v2 with: flutter-version: '3.16.5' From ecca9497f3ea5b63f8ae4e5228065b752bb43c60 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:14:04 +0300 Subject: [PATCH 39/57] Update gradle files --- android/app/build.gradle | 23 +++++++---------------- android/build.gradle | 16 +--------------- android/settings.gradle | 31 +++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 621c09ad..77dc02a4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,10 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" + id "com.google.gms.google-services" version "4.4.0" apply false +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,11 +23,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - - def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { @@ -76,9 +73,3 @@ android { flutter { source '../..' } - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" -} - -apply plugin: 'com.google.gms.google-services' diff --git a/android/build.gradle b/android/build.gradle index 2a089dde..c8cd9380 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,22 +1,8 @@ -buildscript { - ext.kotlin_version = '1.8.10' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.4.1' - classpath 'com.google.gms:google-services:4.3.15' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.2' //add this line for barcode reader - } -} - allprojects { repositories { google() jcenter() + gradlePluginPortal() } } diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14fb..1d6d19b7 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,26 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false } + +include ":app" From afb73c69b060d1d227435e94fd709222f84e8722 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:14:16 +0300 Subject: [PATCH 40/57] Update pubspec lock --- pubspec.lock | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 88b23920..bd4ecd5c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -536,6 +536,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" logging: dependency: transitive description: @@ -548,26 +572,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" mime: dependency: transitive description: @@ -596,10 +620,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: @@ -965,6 +989,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: From c356ebeadeae47c9a5afe681d65e6599e71d813b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:23:45 +0300 Subject: [PATCH 41/57] Generate keystore before build --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43d18352..0414bc54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,10 @@ on: pull_request: branches: - '*' +env: + RELEASE_KEY_ALIAS: mock_alias + RELEASE_KEY_PASSWORD: password + RELEASE_STORE_PASSWORD: password jobs: build: @@ -21,4 +25,16 @@ jobs: with: flutter-version: '3.16.5' channel: 'stable' + - run: + name: Generate keystore + command: keytool -genkey -v -keystore android/keystore -alias $RELEASE_KEY_ALIAS -keyalg RSA -keysize 2048 -validity 10000 -storepass $RELEASE_STORE_PASSWORD -keypass $RELEASE_KEY_PASSWORD -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" + - run: + name: Configure key.properties + command: | + printf " + keyAlias=%s + keyPassword=%s + storeFile=%s + storePassword=%s + " $RELEASE_KEY_ALIAS $RELEASE_KEY_PASSWORD "$(pwd)/android/keystore" $RELEASE_STORE_PASSWORD > android/key.properties - run: flutter build apk From 5df579752268a675ae834963efac918063bc3f86 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:26:30 +0300 Subject: [PATCH 42/57] Split into multiline --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0414bc54..e198b08d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,10 @@ jobs: channel: 'stable' - run: name: Generate keystore - command: keytool -genkey -v -keystore android/keystore -alias $RELEASE_KEY_ALIAS -keyalg RSA -keysize 2048 -validity 10000 -storepass $RELEASE_STORE_PASSWORD -keypass $RELEASE_KEY_PASSWORD -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" + command: | + keytool -genkey -v -keystore android/keystore -alias $RELEASE_KEY_ALIAS \ + -keyalg RSA -keysize 2048 -validity 10000 -storepass $RELEASE_STORE_PASSWORD \ + -keypass $RELEASE_KEY_PASSWORD -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" - run: name: Configure key.properties command: | From d1e9caf0f32b5107b35151761894830939c924bb Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:27:49 +0300 Subject: [PATCH 43/57] Fix GA structure --- .github/workflows/build.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e198b08d..bb752250 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,19 +25,17 @@ jobs: with: flutter-version: '3.16.5' channel: 'stable' - - run: - name: Generate keystore - command: | - keytool -genkey -v -keystore android/keystore -alias $RELEASE_KEY_ALIAS \ - -keyalg RSA -keysize 2048 -validity 10000 -storepass $RELEASE_STORE_PASSWORD \ - -keypass $RELEASE_KEY_PASSWORD -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" - - run: - name: Configure key.properties - command: | - printf " - keyAlias=%s - keyPassword=%s - storeFile=%s - storePassword=%s - " $RELEASE_KEY_ALIAS $RELEASE_KEY_PASSWORD "$(pwd)/android/keystore" $RELEASE_STORE_PASSWORD > android/key.properties + - name: Generate keystore + run: | + keytool -genkey -v -keystore android/keystore -alias $RELEASE_KEY_ALIAS \ + -keyalg RSA -keysize 2048 -validity 10000 -storepass $RELEASE_STORE_PASSWORD \ + -keypass $RELEASE_KEY_PASSWORD -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" + - name: + run: | + printf " + keyAlias=%s + keyPassword=%s + storeFile=%s + storePassword=%s + " $RELEASE_KEY_ALIAS $RELEASE_KEY_PASSWORD "$(pwd)/android/keystore" $RELEASE_STORE_PASSWORD > android/key.properties - run: flutter build apk From 6c16705ace00781580f248c8d7949d8461a757ff Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:29:01 +0300 Subject: [PATCH 44/57] Updat pbxproj --- ios/Runner.xcodeproj/project.pbxproj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index fc997f0f..db0d20e7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -168,7 +168,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -218,6 +218,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -377,6 +378,8 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NAME)"; DEVELOPMENT_TEAM = "$(APPLE_TEAM_ID)"; ENABLE_BITCODE = NO; + FLUTTER_BUILD_DIR = build; + FLUTTER_BUILD_MODE = Debug; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -523,6 +526,8 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NAME)"; DEVELOPMENT_TEAM = 8BS4Z5NKY2; ENABLE_BITCODE = NO; + FLUTTER_BUILD_DIR = build; + FLUTTER_BUILD_MODE = Debug; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -561,6 +566,8 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NAME)"; DEVELOPMENT_TEAM = "$(APPLE_TEAM_ID)"; ENABLE_BITCODE = NO; + FLUTTER_BUILD_DIR = build; + FLUTTER_BUILD_MODE = Debug; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", From 8a432667a442952c3497a1f8b684b18a9b636838 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 15:29:17 +0300 Subject: [PATCH 45/57] Update xcscheme --- ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a3..a6b826db 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 20 Feb 2024 16:01:15 +0300 Subject: [PATCH 46/57] Use CoinCode constructor --- lib/authentication.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/authentication.dart b/lib/authentication.dart index b275cc4f..1ea8d232 100644 --- a/lib/authentication.dart +++ b/lib/authentication.dart @@ -67,7 +67,7 @@ class Authentication { var coins = response['body']['coins'] ?? []; Coins.all = {}; coins.forEach((coin) { - var coinCode = CoinCode.fromString("${coin['code']}_${coin['chain']}"); + var coinCode = CoinCode(coin['code'], coin['chain']); Coins.all[coinCode] = { 'name': coin['name'], From 29d2879d0aa1e92732837fc8927d41fa53157db9 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 17:49:55 +0300 Subject: [PATCH 47/57] Revert handle message --- lib/push_notifications.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/push_notifications.dart b/lib/push_notifications.dart index 9471fd97..66970d91 100644 --- a/lib/push_notifications.dart +++ b/lib/push_notifications.dart @@ -68,7 +68,7 @@ class PushNotificationsManager { print("INIT FIREBASE"); // For iOS request permission first. FirebaseMessaging.instance.requestPermission(); - FirebaseMessaging.instance.getInitialMessage().then((value) => _handleMessage(value)); + FirebaseMessaging.instance.getInitialMessage().then(_handleMessage); FirebaseMessaging.onBackgroundMessage(_handleMessage); String? token = await FirebaseMessaging.instance.getToken(); From 857ff70c12870822c7111d3768d9df0bf860ec58 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 17:52:53 +0300 Subject: [PATCH 48/57] Make title non nullable --- lib/routes/addresses.dart | 4 ++-- lib/routes/create_account.dart | 4 ++-- lib/routes/forgot_password.dart | 4 ++-- lib/routes/login.dart | 4 ++-- lib/routes/navigation.dart | 4 ++-- lib/routes/set_currency.dart | 4 ++-- lib/routes/settings.dart | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/routes/addresses.dart b/lib/routes/addresses.dart index eb29dadc..6dfcb128 100644 --- a/lib/routes/addresses.dart +++ b/lib/routes/addresses.dart @@ -13,9 +13,9 @@ class Addresses extends StatelessWidget { } class AddressesPage extends StatefulWidget { - AddressesPage({Key? key, this.title}) : super(key: key); + AddressesPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _AddressesPageState createState() => _AddressesPageState(); diff --git a/lib/routes/create_account.dart b/lib/routes/create_account.dart index 64e3a2f8..0898664a 100644 --- a/lib/routes/create_account.dart +++ b/lib/routes/create_account.dart @@ -13,9 +13,9 @@ class CreateAccount extends StatelessWidget { } class CreateAccountPage extends StatefulWidget { - CreateAccountPage({Key? key, this.title}) : super(key: key); + CreateAccountPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _CreateAccountPageState createState() => _CreateAccountPageState(); diff --git a/lib/routes/forgot_password.dart b/lib/routes/forgot_password.dart index bd47acc9..6f57084c 100644 --- a/lib/routes/forgot_password.dart +++ b/lib/routes/forgot_password.dart @@ -13,9 +13,9 @@ class ForgotPassword extends StatelessWidget { } class ForgotPasswordPage extends StatefulWidget { - ForgotPasswordPage({Key? key, this.title}) : super(key: key); + ForgotPasswordPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _ForgotPasswordPageState createState() => _ForgotPasswordPageState(); diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 68301c8b..8ea8a5a5 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -14,9 +14,9 @@ class Login extends StatelessWidget { } class LoginPage extends StatefulWidget { - LoginPage({Key? key, this.title}) : super(key: key); + LoginPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _LoginPageState createState() => _LoginPageState(); diff --git a/lib/routes/navigation.dart b/lib/routes/navigation.dart index be51fc71..2dd12e32 100644 --- a/lib/routes/navigation.dart +++ b/lib/routes/navigation.dart @@ -11,9 +11,9 @@ class Navigation extends StatelessWidget { } class NavigationPage extends StatefulWidget { - NavigationPage({Key? key, this.title}) : super(key: key); + NavigationPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _NavigationPageState createState() => _NavigationPageState(); diff --git a/lib/routes/set_currency.dart b/lib/routes/set_currency.dart index c7bd2390..a25d7aa8 100644 --- a/lib/routes/set_currency.dart +++ b/lib/routes/set_currency.dart @@ -13,9 +13,9 @@ class SetCurrency extends StatelessWidget { } class SetCurrencyPage extends StatefulWidget { - SetCurrencyPage({Key? key, this.title}) : super(key: key); + SetCurrencyPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _SetCurrencyPageState createState() => _SetCurrencyPageState(); diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index 6942f9e1..2cf57c47 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -12,9 +12,9 @@ class Settings extends StatelessWidget { } class SettingsPage extends StatefulWidget { - SettingsPage({Key? key, this.title}) : super(key: key); + SettingsPage({Key? key, required this.title}) : super(key: key); - final String? title; + final String title; @override _SettingsPageState createState() => _SettingsPageState(); From 3b56850f86a5b01f95d8088dbaf7e655d9ec5bd9 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 17:57:24 +0300 Subject: [PATCH 49/57] Make non nullable --- lib/routes/edit_business_info.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index 138418b5..d4ef0b51 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -16,9 +16,9 @@ class EditBusinessInfo extends StatelessWidget { } class EditBusinessInfoPage extends StatefulWidget { - EditBusinessInfoPage({Key? key, this.allowBack}) : super(key: key); + EditBusinessInfoPage({Key? key, required this.allowBack}) : super(key: key); - final bool? allowBack; + final bool allowBack; @override _EditBusinessInfoPageState createState() => _EditBusinessInfoPageState(allowBack); From e9e34963af66be975829a9d6051bad52b52bfdea Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 17:58:50 +0300 Subject: [PATCH 50/57] Remove unneeded --- lib/routes/forgot_password.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/forgot_password.dart b/lib/routes/forgot_password.dart index 6f57084c..29b0e039 100644 --- a/lib/routes/forgot_password.dart +++ b/lib/routes/forgot_password.dart @@ -37,7 +37,7 @@ class _ForgotPasswordPageState extends State { void _submitForm() { _closeKeyboard(); - if (_formKey.currentState != null && _formKey.currentState!.validate()) { + if (_formKey.currentState!.validate()) { setState(() { _submitting = true; _errorMessage = ""; From 4e264db7ae688115daeb101b2712488792e854a7 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 17:59:32 +0300 Subject: [PATCH 51/57] Remove unneeded --- lib/routes/edit_business_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/edit_business_info.dart b/lib/routes/edit_business_info.dart index d4ef0b51..4c83e13e 100644 --- a/lib/routes/edit_business_info.dart +++ b/lib/routes/edit_business_info.dart @@ -91,7 +91,7 @@ class _EditBusinessInfoPageState extends State { _successMessage = ""; }); _closeKeyboard(); - if (_formKey.currentState != null && _formKey.currentState!.validate()) { + if (_formKey.currentState!.validate()) { Authentication.updateAccount({ 'physical_address': address.text, 'business_name': name.text, From 25bd81adbefcafca74119fedfcc55b331126ab56 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:02:54 +0300 Subject: [PATCH 52/57] Revert identation --- lib/routes/invoice.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/routes/invoice.dart b/lib/routes/invoice.dart index b24645d1..2bd605ec 100644 --- a/lib/routes/invoice.dart +++ b/lib/routes/invoice.dart @@ -29,12 +29,12 @@ class ShowInvoice extends StatelessWidget { } class InvoicePage extends StatefulWidget { - InvoicePage({Key? key, this.id}) : super(key: key); + InvoicePage({Key? key, required this.id}) : super(key: key); - final String? id; + final String id; @override - _InvoicePageState createState() => _InvoicePageState(id ?? ''); + _InvoicePageState createState() => _InvoicePageState(id); } class _InvoicePageState extends State { @@ -585,9 +585,9 @@ class _InvoicePageState extends State { Widget _InvoiceComponent() { return AnimatedOpacity( - opacity: _invoiceReady ? 1.0 : 0.0, - duration: Duration(milliseconds: 300), - child: Column( + opacity: _invoiceReady ? 1.0 : 0.0, + duration: Duration(milliseconds: 300), + child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Text(_successMessage, From a004fef01477da502273b175ea5ab178fb32bcbd Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:03:57 +0300 Subject: [PATCH 53/57] Revert identation --- lib/routes/invoice.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/routes/invoice.dart b/lib/routes/invoice.dart index 2bd605ec..8954990f 100644 --- a/lib/routes/invoice.dart +++ b/lib/routes/invoice.dart @@ -672,8 +672,7 @@ class _InvoicePageState extends State { padding: EdgeInsets.only(left: 15), child: Image( image: AppController.enableDarkMode ? - AssetImage( - 'assets/images/share-white.png') : + AssetImage('assets/images/share-white.png') : AssetImage('assets/images/share.png'), width: 20, ) From 5003a9425cfcb45b6fd85dc9569f418a40e8271f Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:05:00 +0300 Subject: [PATCH 54/57] Remove debug print --- lib/routes/login.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/routes/login.dart b/lib/routes/login.dart index 8ea8a5a5..41e4851c 100644 --- a/lib/routes/login.dart +++ b/lib/routes/login.dart @@ -72,7 +72,6 @@ class _LoginPageState extends State { AppController.closeUntilPath('/new-invoice'); } else setState(() { - print(jsonEncode(response)); var body = response['body']; var payload = body['payload']; _errorMessage = payload['message']; From 51c75fbb092c09420a0f32cfc0029f26fabbf9b9 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:19:01 +0300 Subject: [PATCH 55/57] Fallback to white --- lib/routes/new_address.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/new_address.dart b/lib/routes/new_address.dart index 77974c1c..7c14f067 100644 --- a/lib/routes/new_address.dart +++ b/lib/routes/new_address.dart @@ -216,12 +216,12 @@ class _NewAddressPageState extends State { AppController.closeUntilPath('/new-invoice'); } - Color? _messageColor() { + Color _messageColor() { return { 'pending': Theme.of(context).primaryColorDark, 'success': AppController.green, 'error': AppController.red, - }[_messageType]; + }[_messageType] ?? Colors.white; } void _closeKeyboard() { From 868c4d467f1558b26c6637f60e35e36ecc5eff0c Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:21:14 +0300 Subject: [PATCH 56/57] Fix id --- lib/routes/payment.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/payment.dart b/lib/routes/payment.dart index edd6152e..248c6f9e 100644 --- a/lib/routes/payment.dart +++ b/lib/routes/payment.dart @@ -20,12 +20,12 @@ class Payment extends StatelessWidget { } class PaymentPage extends StatefulWidget { - PaymentPage({Key? key, this.id}) : super(key: key); + PaymentPage({Key? key, required this.id}) : super(key: key); - final String? id; + final String id; @override - _PaymentPageState createState() => _PaymentPageState(id ?? ''); + _PaymentPageState createState() => _PaymentPageState(id); } class _PaymentPageState extends State { From 1f3accc9d44b06beca2558a25c4667901e866718 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Tue, 20 Feb 2024 18:25:14 +0300 Subject: [PATCH 57/57] Fix null condition --- lib/routes/settings.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/routes/settings.dart b/lib/routes/settings.dart index 2cf57c47..cbcf4b50 100644 --- a/lib/routes/settings.dart +++ b/lib/routes/settings.dart @@ -70,8 +70,13 @@ class _SettingsPageState extends State { void _rebuild() { setState(() { - denomination = Authentication.currentAccount.denomination ?? 'USD'; - symbol = Currencies.all[denomination]!['symbol']; + if (Authentication.currentAccount.denomination != null) { + denomination = Authentication.currentAccount.denomination; + symbol = Currencies.all[denomination]!['symbol']; + } else { + denomination = 'USD'; + symbol = '\$'; + } }); }