diff --git a/.DS_Store b/.DS_Store
index dac28d8..acfc3e5 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/android/app/google-services.json b/android/app/google-services.json
index 6db7eeb..20d033b 100644
--- a/android/app/google-services.json
+++ b/android/app/google-services.json
@@ -1,62 +1,45 @@
{
"project_info": {
- "project_number": "280510379185",
- "firebase_url": "https://teso-ghana-default-rtdb.firebaseio.com",
- "project_id": "teso-ghana",
- "storage_bucket": "teso-ghana.appspot.com"
+ "project_number": "675860686596",
+ "project_id": "teso-test-6fc81",
+ "storage_bucket": "teso-test-6fc81.appspot.com"
},
"client": [
{
"client_info": {
- "mobilesdk_app_id": "1:280510379185:android:b778de8dca1cf49219de90",
+ "mobilesdk_app_id": "1:675860686596:android:8522b46df172af41cd9251",
"android_client_info": {
"package_name": "com.sparentechBacware.teso"
}
},
"oauth_client": [
{
- "client_id": "280510379185-0shp8sia3i5m589bov645t3kuddb1032.apps.googleusercontent.com",
+ "client_id": "675860686596-in4piqob6d8nj42nguh06abpdrrhai0f.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.sparentechBacware.teso",
- "certificate_hash": "40b68890dd51d72454ccdc7289623c4d56273248"
+ "certificate_hash": "b50b0b74dfcde0a02336f00eae49428a517551b2"
}
},
{
- "client_id": "280510379185-87k85sksrd30mu9fjgfmacb3bkcjnmdq.apps.googleusercontent.com",
- "client_type": 1,
- "android_info": {
- "package_name": "com.sparentechBacware.teso",
- "certificate_hash": "4f655cf94cd94864838475611b711c2528e33601"
- }
- },
- {
- "client_id": "280510379185-ac7qjglm9cct9u0diqrns6om8t2mb9ug.apps.googleusercontent.com",
- "client_type": 1,
- "android_info": {
- "package_name": "com.sparentechBacware.teso",
- "certificate_hash": "063304c2da41f90c824fad163b5ad481edf6db11"
- }
- },
- {
- "client_id": "280510379185-58chj1fi4pts4p7p7sieq16miapvtepi.apps.googleusercontent.com",
+ "client_id": "675860686596-n32ta36ndmugfm1jj61mu2p1v197a1nn.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
- "current_key": "AIzaSyAHBguF6oqPEq7em1vLrh_NP2LoPuabe6o"
+ "current_key": "AIzaSyDt05opA09hr9Y1pysllCsEE_6dT4CrhRM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
- "client_id": "280510379185-58chj1fi4pts4p7p7sieq16miapvtepi.apps.googleusercontent.com",
+ "client_id": "675860686596-n32ta36ndmugfm1jj61mu2p1v197a1nn.apps.googleusercontent.com",
"client_type": 3
},
{
- "client_id": "280510379185-67vianhh973klriv75ip2tb9cf8ibitl.apps.googleusercontent.com",
+ "client_id": "675860686596-8dsd5qf42n1gej04f2m2rmt27neft8vg.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.tesoapp",
diff --git a/assets/.DS_Store b/assets/.DS_Store
new file mode 100644
index 0000000..af79403
Binary files /dev/null and b/assets/.DS_Store differ
diff --git a/assets/images/.DS_Store b/assets/images/.DS_Store
new file mode 100644
index 0000000..d1dd2d5
Binary files /dev/null and b/assets/images/.DS_Store differ
diff --git a/assets/images/coupon.svg b/assets/images/coupon.svg
new file mode 100644
index 0000000..afaa12f
--- /dev/null
+++ b/assets/images/coupon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/images/search.svg b/assets/images/search.svg
new file mode 100644
index 0000000..0d9ddca
--- /dev/null
+++ b/assets/images/search.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/ios/Podfile b/ios/Podfile
index 74a05be..b6d908a 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -1,7 +1,7 @@
# Uncomment this line to define a global platform for your project
-platform :ios, '12.0'
+platform :ios, '15.0'
# Override Firebase SDK Version
-$FirebaseSDKVersion = '8.15.0'
+ $FirebaseSDKVersion = '9.2.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -39,7 +39,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
\ No newline at end of file
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index ef07a3f..e2dde26 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -608,102 +608,105 @@ PODS:
- BoringSSL-GRPC/Implementation (0.0.24):
- BoringSSL-GRPC/Interface (= 0.0.24)
- BoringSSL-GRPC/Interface (0.0.24)
- - camera (0.0.1):
+ - camera_avfoundation (0.0.1):
- Flutter
- - cloud_firestore (3.1.15):
- - Firebase/Firestore (= 8.15.0)
+ - cloud_firestore (3.2.0):
+ - Firebase/Firestore (= 9.2.0)
- firebase_core
- Flutter
- connectivity (0.0.1):
- Flutter
- Reachability
- - Firebase/Analytics (8.15.0):
+ - Firebase/Analytics (9.2.0):
- Firebase/Core
- - Firebase/Auth (8.15.0):
+ - Firebase/Auth (9.2.0):
- Firebase/CoreOnly
- - FirebaseAuth (~> 8.15.0)
- - Firebase/Core (8.15.0):
+ - FirebaseAuth (~> 9.2.0)
+ - Firebase/Core (9.2.0):
- Firebase/CoreOnly
- - FirebaseAnalytics (~> 8.15.0)
- - Firebase/CoreOnly (8.15.0):
- - FirebaseCore (= 8.15.0)
- - Firebase/Crashlytics (8.15.0):
+ - FirebaseAnalytics (~> 9.2.0)
+ - Firebase/CoreOnly (9.2.0):
+ - FirebaseCore (= 9.2.0)
+ - Firebase/Crashlytics (9.2.0):
- Firebase/CoreOnly
- - FirebaseCrashlytics (~> 8.15.0)
- - Firebase/DynamicLinks (8.15.0):
+ - FirebaseCrashlytics (~> 9.2.0)
+ - Firebase/DynamicLinks (9.2.0):
- Firebase/CoreOnly
- - FirebaseDynamicLinks (~> 8.15.0)
- - Firebase/Firestore (8.15.0):
+ - FirebaseDynamicLinks (~> 9.2.0)
+ - Firebase/Firestore (9.2.0):
- Firebase/CoreOnly
- - FirebaseFirestore (~> 8.15.0)
- - Firebase/Messaging (8.15.0):
+ - FirebaseFirestore (~> 9.2.0)
+ - Firebase/Messaging (9.2.0):
- Firebase/CoreOnly
- - FirebaseMessaging (~> 8.15.0)
- - firebase_analytics (9.1.8):
- - Firebase/Analytics (= 8.15.0)
+ - FirebaseMessaging (~> 9.2.0)
+ - firebase_analytics (9.1.11):
+ - Firebase/Analytics (= 9.2.0)
- firebase_core
- Flutter
- - firebase_auth (3.3.18):
- - Firebase/Auth (= 8.15.0)
+ - firebase_auth (3.4.0):
+ - Firebase/Auth (= 9.2.0)
- firebase_core
- Flutter
- - firebase_core (1.17.0):
- - Firebase/CoreOnly (= 8.15.0)
+ - firebase_core (1.22.0):
+ - Firebase/CoreOnly (= 9.2.0)
- Flutter
- - firebase_crashlytics (2.8.0):
- - Firebase/Crashlytics (= 8.15.0)
+ - firebase_crashlytics (2.8.3):
+ - Firebase/Crashlytics (= 9.2.0)
- firebase_core
- Flutter
- - firebase_dynamic_links (4.2.3):
- - Firebase/DynamicLinks (= 8.15.0)
+ - firebase_dynamic_links (4.3.0):
+ - Firebase/DynamicLinks (= 9.2.0)
- firebase_core
- Flutter
- - firebase_messaging (11.4.0):
- - Firebase/Messaging (= 8.15.0)
+ - firebase_messaging (11.4.3):
+ - Firebase/Messaging (= 9.2.0)
- firebase_core
- Flutter
- - FirebaseAnalytics (8.15.0):
- - FirebaseAnalytics/AdIdSupport (= 8.15.0)
- - FirebaseCore (~> 8.0)
- - FirebaseInstallations (~> 8.0)
+ - FirebaseAnalytics (9.2.0):
+ - FirebaseAnalytics/AdIdSupport (= 9.2.0)
+ - FirebaseCore (~> 9.0)
+ - FirebaseInstallations (~> 9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- - nanopb (~> 2.30908.0)
- - FirebaseAnalytics/AdIdSupport (8.15.0):
- - FirebaseCore (~> 8.0)
- - FirebaseInstallations (~> 8.0)
- - GoogleAppMeasurement (= 8.15.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - FirebaseAnalytics/AdIdSupport (9.2.0):
+ - FirebaseCore (~> 9.0)
+ - FirebaseInstallations (~> 9.0)
+ - GoogleAppMeasurement (= 9.2.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- - nanopb (~> 2.30908.0)
- - FirebaseAuth (8.15.0):
- - FirebaseCore (~> 8.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - FirebaseAuth (9.2.0):
+ - FirebaseCore (~> 9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/Environment (~> 7.7)
- - GTMSessionFetcher/Core (~> 1.5)
- - FirebaseCore (8.15.0):
- - FirebaseCoreDiagnostics (~> 8.0)
+ - GTMSessionFetcher/Core (< 3.0, >= 1.7)
+ - FirebaseCore (9.2.0):
+ - FirebaseCoreDiagnostics (~> 9.0)
+ - FirebaseCoreInternal (~> 9.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- - FirebaseCoreDiagnostics (8.15.0):
- - GoogleDataTransport (~> 9.1)
+ - FirebaseCoreDiagnostics (9.5.0):
+ - GoogleDataTransport (< 10.0.0, >= 9.1.4)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- - nanopb (~> 2.30908.0)
- - FirebaseCrashlytics (8.15.0):
- - FirebaseCore (~> 8.0)
- - FirebaseInstallations (~> 8.0)
- - GoogleDataTransport (~> 9.1)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - FirebaseCoreInternal (9.5.0):
+ - "GoogleUtilities/NSData+zlib (~> 7.7)"
+ - FirebaseCrashlytics (9.2.0):
+ - FirebaseCore (~> 9.0)
+ - FirebaseInstallations (~> 9.0)
+ - GoogleDataTransport (< 10.0.0, >= 9.1.4)
- GoogleUtilities/Environment (~> 7.7)
- - nanopb (~> 2.30908.0)
- - PromisesObjC (< 3.0, >= 1.2)
- - FirebaseDynamicLinks (8.15.0):
- - FirebaseCore (~> 8.0)
- - FirebaseFirestore (8.15.0):
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - PromisesObjC (~> 2.1)
+ - FirebaseDynamicLinks (9.2.0):
+ - FirebaseCore (~> 9.0)
+ - FirebaseFirestore (9.2.0):
- abseil/algorithm (~> 1.20211102.0)
- abseil/base (~> 1.20211102.0)
- abseil/container/flat_hash_map (~> 1.20211102.0)
@@ -712,24 +715,24 @@ PODS:
- abseil/strings/strings (~> 1.20211102.0)
- abseil/time (~> 1.20211102.0)
- abseil/types (~> 1.20211102.0)
- - FirebaseCore (~> 8.0)
+ - FirebaseCore (~> 9.0)
- "gRPC-C++ (~> 1.44.0)"
- leveldb-library (~> 1.22)
- - nanopb (~> 2.30908.0)
- - FirebaseInstallations (8.15.0):
- - FirebaseCore (~> 8.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - FirebaseInstallations (9.5.0):
+ - FirebaseCore (~> 9.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- - PromisesObjC (< 3.0, >= 1.2)
- - FirebaseMessaging (8.15.0):
- - FirebaseCore (~> 8.0)
- - FirebaseInstallations (~> 8.0)
- - GoogleDataTransport (~> 9.1)
+ - PromisesObjC (~> 2.1)
+ - FirebaseMessaging (9.2.0):
+ - FirebaseCore (~> 9.0)
+ - FirebaseInstallations (~> 9.0)
+ - GoogleDataTransport (< 10.0.0, >= 9.1.4)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Reachability (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- - nanopb (~> 2.30908.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
- Flutter (1.0.0)
- flutter_inappwebview (0.0.1):
- Flutter
@@ -753,7 +756,7 @@ PODS:
- FMDB/standard (2.7.5)
- geolocator_apple (1.2.0):
- Flutter
- - google_maps_flutter (0.0.1):
+ - google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps
- google_ml_vision (0.0.7):
@@ -765,26 +768,26 @@ PODS:
- google_sign_in_ios (0.0.1):
- Flutter
- GoogleSignIn (~> 6.2)
- - GoogleAppMeasurement (8.15.0):
- - GoogleAppMeasurement/AdIdSupport (= 8.15.0)
+ - GoogleAppMeasurement (9.2.0):
+ - GoogleAppMeasurement/AdIdSupport (= 9.2.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- - nanopb (~> 2.30908.0)
- - GoogleAppMeasurement/AdIdSupport (8.15.0):
- - GoogleAppMeasurement/WithoutAdIdSupport (= 8.15.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - GoogleAppMeasurement/AdIdSupport (9.2.0):
+ - GoogleAppMeasurement/WithoutAdIdSupport (= 9.2.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- - nanopb (~> 2.30908.0)
- - GoogleAppMeasurement/WithoutAdIdSupport (8.15.0):
+ - nanopb (< 2.30910.0, >= 2.30908.0)
+ - GoogleAppMeasurement/WithoutAdIdSupport (9.2.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- - nanopb (~> 2.30908.0)
+ - nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleDataTransport (9.1.4):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
@@ -976,7 +979,7 @@ PODS:
- permission_handler_apple (9.0.4):
- Flutter
- PhoneNumberKit/PhoneNumberKitCore (3.3.4)
- - PromisesObjC (2.1.0)
+ - PromisesObjC (2.1.1)
- Protobuf (3.20.1)
- Reachability (3.2)
- share_plus (0.0.1):
@@ -995,7 +998,7 @@ PODS:
- Flutter
DEPENDENCIES:
- - camera (from `.symlinks/plugins/camera/ios`)
+ - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
@@ -1011,7 +1014,7 @@ DEPENDENCIES:
- flutter_qrcode_scanner (from `.symlinks/plugins/flutter_qrcode_scanner/ios`)
- flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
+ - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- google_ml_vision (from `.symlinks/plugins/google_ml_vision/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
@@ -1038,6 +1041,7 @@ SPEC REPOS:
- FirebaseAuth
- FirebaseCore
- FirebaseCoreDiagnostics
+ - FirebaseCoreInternal
- FirebaseCrashlytics
- FirebaseDynamicLinks
- FirebaseFirestore
@@ -1079,8 +1083,8 @@ SPEC REPOS:
- TOCropViewController
EXTERNAL SOURCES:
- camera:
- :path: ".symlinks/plugins/camera/ios"
+ camera_avfoundation:
+ :path: ".symlinks/plugins/camera_avfoundation/ios"
cloud_firestore:
:path: ".symlinks/plugins/cloud_firestore/ios"
connectivity:
@@ -1111,8 +1115,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_webview_plugin/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios"
- google_maps_flutter:
- :path: ".symlinks/plugins/google_maps_flutter/ios"
+ google_maps_flutter_ios:
+ :path: ".symlinks/plugins/google_maps_flutter_ios/ios"
google_ml_vision:
:path: ".symlinks/plugins/google_ml_vision/ios"
google_sign_in_ios:
@@ -1148,25 +1152,26 @@ SPEC CHECKSUMS:
abseil: ebe5b5529fb05d93a8bdb7951607be08b7fa71bc
AppAuth: 80317d99ac7ff2801a2f18ff86b48cd315ed465d
BoringSSL-GRPC: 3175b25143e648463a56daeaaa499c6cb86dad33
- camera: 9993f92f2c793e87b65e35f3a23c70582afb05b1
- cloud_firestore: 76e73835a6ac79ac825190eefd876a1e100c7835
+ camera_avfoundation: 07c77549ea54ad95d8581be86617c094a46280d9
+ cloud_firestore: 30fe479181386bcf28579a0b4bf1654c89b88542
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
- Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
- firebase_analytics: 92d27947c7516981cabdc0acbb33cd0687bcda44
- firebase_auth: ace975b530600827bd901a9a18584f7cdaf6d160
- firebase_core: aa1b92020533f5c23955e388c347c58fd64f8627
- firebase_crashlytics: d42b108fa870b889f4c4ea22094647f2aca5f765
- firebase_dynamic_links: 7263ea02f9eb9af202173d2ec093120340e38677
- firebase_messaging: 8957bf304b47daf8bf12d0b111fdecc5b33e77a3
- FirebaseAnalytics: 7761cbadb00a717d8d0939363eb46041526474fa
- FirebaseAuth: 3e73bf8abf4fbb40f8b421f361f4cc48ee57388c
- FirebaseCore: 5743c5785c074a794d35f2fff7ecc254a91e08b1
- FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
- FirebaseCrashlytics: feb07e4e9187be3c23c6a846cce4824e5ce2dd0b
- FirebaseDynamicLinks: 1dc816ef789c5adac6fede0b46d11478175c70e4
- FirebaseFirestore: d7023faff8e1b4fd69d0adbcf18e65129bc03842
- FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
- FirebaseMessaging: 5e5118a2383b3531e730d974680954c679ca0a13
+ Firebase: 4ba896cb8e5105d4b9e247e1c1b6222b548df55a
+ firebase_analytics: ff0cb0848b62fea2c6cf93dfd08135130f194de8
+ firebase_auth: 4844b43012019d01268544a497b5a9757f69027b
+ firebase_core: 07ad4db354f9b07c54809df99dbe6dd5f7256872
+ firebase_crashlytics: e0040786f14b369cc717037d124ae124d40c6460
+ firebase_dynamic_links: e2d08d5e0cd443258a54137a61247e92d5e1a1c4
+ firebase_messaging: 753569fe9d79bcc694bab3526b168d248b512ce2
+ FirebaseAnalytics: af5a03a8dff7648c7b8486f6a78b1368e0268dd3
+ FirebaseAuth: 1c574ab64a051dd86dbe7fd5a3f86b58155b3482
+ FirebaseCore: 0e27f2a15d8f7b7ef11e7d93e23b1cbab55d748c
+ FirebaseCoreDiagnostics: 17cbf4e72b1dbd64bfdc33d4b1f07bce4f16f1d8
+ FirebaseCoreInternal: 50a8e39cae8abf72d5145d07ea34c3244f70862b
+ FirebaseCrashlytics: 9fff819edb2bfc9d3eff612225b207d41945a935
+ FirebaseDynamicLinks: f576ccfba05f2813e3679d48ccae5bcfff5714fc
+ FirebaseFirestore: de27d96de10596ebc114adf25c6aa7d36dd91f2f
+ FirebaseInstallations: 41f811b530c41dd90973d0174381cdb3fcb5e839
+ FirebaseMessaging: 4eaf1b8a7464b2c5e619ad66e9b20ee3e3206b24
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_libphonenumber: 6a23afdf063b34d1e53e6dbd6c6bc905d18e8e46
@@ -1175,10 +1180,10 @@ SPEC CHECKSUMS:
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
- google_maps_flutter: c59fc576c0d0c7f4dc4bd63832c862d22d5a7c6d
+ google_maps_flutter_ios: 66201f392bf62d500f07670a30488a247b9bb5b9
google_ml_vision: d16cd76617b3260c4283a28843555a8c6253a171
- google_sign_in_ios: 90eec6616c4c2105b9f9fe5c774773d13565b504
- GoogleAppMeasurement: 4c19f031220c72464d460c9daa1fb5d1acce958e
+ google_sign_in_ios: 4f85eb9f937450765c8573bb85fd8cd6a5af675c
+ GoogleAppMeasurement: 7a33224321f975d58c166657260526775d9c6b1a
GoogleDataTransport: 5fffe35792f8b96ec8d6775f5eccd83c998d5a3b
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
GoogleMLKit: 85ffdc9641d05311c76dbba5bbf93059087be12f
@@ -1214,7 +1219,7 @@ SPEC CHECKSUMS:
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
PhoneNumberKit: 441e8b26ec88d598e3591de9061eff18f5dd12e8
- PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72
+ PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
Protobuf: b60ec2f51ad74765f44d0c09d2e0579d7de21745
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
@@ -1225,6 +1230,6 @@ SPEC CHECKSUMS:
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f
-PODFILE CHECKSUM: c62121d8312d0ff0e0c4dd40334ffbc665ef58ad
+PODFILE CHECKSUM: 2123a5cc771d730e237b041002bf2d3b6ae5004b
COCOAPODS: 1.11.3
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index b881125..b5cbb9b 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -13,8 +13,8 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
- 98FE50F8283B030E00F3547E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 98FE50F7283B030D00F3547E /* GoogleService-Info.plist */; };
DE7D3950774AF2253178F202 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29578401A5FB3088ABB7635B /* Pods_Runner.framework */; };
+ FE1744D5ADF4D39D2F573FCB /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 0B3B84CDB01189B80ADF6D47 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,6 +31,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 0B3B84CDB01189B80ADF6D47 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
29578401A5FB3088ABB7635B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -46,7 +47,6 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 98FE50F7283B030D00F3547E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = ""; };
A59F426903D2E7C7F7F74FB8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
DD7F4377AC18215A9CA08DC8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
@@ -100,6 +100,7 @@
97C146EF1CF9000F007C117D /* Products */,
4334E30C393B71F7A6E589D8 /* Pods */,
23D06BD6AD1FD965EEBFDFB4 /* Frameworks */,
+ 0B3B84CDB01189B80ADF6D47 /* GoogleService-Info.plist */,
);
sourceTree = "";
};
@@ -114,7 +115,6 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
- 98FE50F7283B030D00F3547E /* GoogleService-Info.plist */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -194,7 +194,6 @@
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 98FE50F8283B030E00F3547E /* GoogleService-Info.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
@@ -316,6 +315,7 @@
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ FE1744D5ADF4D39D2F573FCB /* GoogleService-Info.plist in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/ios/Runner/.DS_Store b/ios/Runner/.DS_Store
index 6ee4398..483ddf9 100644
Binary files a/ios/Runner/.DS_Store and b/ios/Runner/.DS_Store differ
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
index f3c2851..e8a9143 100644
--- a/ios/Runner/Base.lproj/Main.storyboard
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -1,8 +1,10 @@
-
-
+
+
+
-
+
+
@@ -14,13 +16,14 @@
-
+
-
+
+
diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist
index a306f47..b88ab6e 100644
--- a/ios/Runner/GoogleService-Info.plist
+++ b/ios/Runner/GoogleService-Info.plist
@@ -3,23 +3,23 @@
CLIENT_ID
- 280510379185-67vianhh973klriv75ip2tb9cf8ibitl.apps.googleusercontent.com
+ 675860686596-8dsd5qf42n1gej04f2m2rmt27neft8vg.apps.googleusercontent.com
REVERSED_CLIENT_ID
- com.googleusercontent.apps.280510379185-67vianhh973klriv75ip2tb9cf8ibitl
+ com.googleusercontent.apps.675860686596-8dsd5qf42n1gej04f2m2rmt27neft8vg
ANDROID_CLIENT_ID
- 280510379185-0shp8sia3i5m589bov645t3kuddb1032.apps.googleusercontent.com
+ 675860686596-in4piqob6d8nj42nguh06abpdrrhai0f.apps.googleusercontent.com
API_KEY
- AIzaSyCBDtZO2_Z5JjrNj1TocK6YAlk_wDbzZHs
+ AIzaSyDBcm0Bpx8tucyVx3Cwe48ehqcWGPWThzI
GCM_SENDER_ID
- 280510379185
+ 675860686596
PLIST_VERSION
1
BUNDLE_ID
com.tesoapp
PROJECT_ID
- teso-ghana
+ teso-test-6fc81
STORAGE_BUCKET
- teso-ghana.appspot.com
+ teso-test-6fc81.appspot.com
IS_ADS_ENABLED
IS_ANALYTICS_ENABLED
@@ -31,8 +31,6 @@
IS_SIGNIN_ENABLED
GOOGLE_APP_ID
- 1:280510379185:ios:52af12a619d5443119de90
- DATABASE_URL
- https://teso-ghana-default-rtdb.firebaseio.com
+ 1:675860686596:ios:41d840f75d89875ccd9251
\ No newline at end of file
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 8fe164a..b3a451a 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -34,6 +34,7 @@
CFBundleURLSchemes
com.googleusercontent.apps.280510379185-67vianhh973klriv75ip2tb9cf8ibitl
+ com.googleusercontent.apps.675860686596-8dsd5qf42n1gej04f2m2rmt27neft8vg
fb1759156777594606
diff --git a/ios/Runner/ProdGoogleService-Info.plist b/ios/Runner/ProdGoogleService-Info.plist
new file mode 100644
index 0000000..a306f47
--- /dev/null
+++ b/ios/Runner/ProdGoogleService-Info.plist
@@ -0,0 +1,38 @@
+
+
+
+
+ CLIENT_ID
+ 280510379185-67vianhh973klriv75ip2tb9cf8ibitl.apps.googleusercontent.com
+ REVERSED_CLIENT_ID
+ com.googleusercontent.apps.280510379185-67vianhh973klriv75ip2tb9cf8ibitl
+ ANDROID_CLIENT_ID
+ 280510379185-0shp8sia3i5m589bov645t3kuddb1032.apps.googleusercontent.com
+ API_KEY
+ AIzaSyCBDtZO2_Z5JjrNj1TocK6YAlk_wDbzZHs
+ GCM_SENDER_ID
+ 280510379185
+ PLIST_VERSION
+ 1
+ BUNDLE_ID
+ com.tesoapp
+ PROJECT_ID
+ teso-ghana
+ STORAGE_BUCKET
+ teso-ghana.appspot.com
+ IS_ADS_ENABLED
+
+ IS_ANALYTICS_ENABLED
+
+ IS_APPINVITE_ENABLED
+
+ IS_GCM_ENABLED
+
+ IS_SIGNIN_ENABLED
+
+ GOOGLE_APP_ID
+ 1:280510379185:ios:52af12a619d5443119de90
+ DATABASE_URL
+ https://teso-ghana-default-rtdb.firebaseio.com
+
+
\ No newline at end of file
diff --git a/ios/firebase_app_id_file.json b/ios/firebase_app_id_file.json
index 65919f5..df3ad8a 100644
--- a/ios/firebase_app_id_file.json
+++ b/ios/firebase_app_id_file.json
@@ -1,7 +1,7 @@
{
"file_generated_by": "FlutterFire CLI",
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
- "GOOGLE_APP_ID": "1:280510379185:ios:52af12a619d5443119de90",
- "FIREBASE_PROJECT_ID": "teso-ghana",
- "GCM_SENDER_ID": "280510379185"
+ "GOOGLE_APP_ID": "1:675860686596:ios:41d840f75d89875ccd9251",
+ "FIREBASE_PROJECT_ID": "teso-test-6fc81",
+ "GCM_SENDER_ID": "675860686596"
}
\ No newline at end of file
diff --git a/lib/Classes/API Clasess/BusinessProfile.dart b/lib/Classes/API Clasess/BusinessProfile.dart
index fbfef27..57524a1 100644
--- a/lib/Classes/API Clasess/BusinessProfile.dart
+++ b/lib/Classes/API Clasess/BusinessProfile.dart
@@ -4,10 +4,10 @@ import 'package:teso/Classes/API%20Clasess/Product.dart';
import '../TesoUser.dart';
class BusinessProfileClass {
- List products;
- List coupons;
- List subscribers;
- bool subscribed;
+ List? products;
+ List? coupons;
+ List? subscribers;
+ bool? subscribed;
BusinessProfileClass({
this.coupons,
diff --git a/lib/Classes/API Clasess/CampAd.dart b/lib/Classes/API Clasess/CampAd.dart
index 2b23306..0988321 100644
--- a/lib/Classes/API Clasess/CampAd.dart
+++ b/lib/Classes/API Clasess/CampAd.dart
@@ -1,7 +1,7 @@
class CampAd {
- String postId;
- String campaignId;
- bool approved;
+ String? postId;
+ String? campaignId;
+ bool? approved;
CampAd({
this.approved,
diff --git a/lib/Classes/API Clasess/Campaign.dart b/lib/Classes/API Clasess/Campaign.dart
index 7dc5c72..cb8d753 100644
--- a/lib/Classes/API Clasess/Campaign.dart
+++ b/lib/Classes/API Clasess/Campaign.dart
@@ -1,12 +1,12 @@
class Campaign {
- String campaignID;
- String description;
- String businessID;
- String status;
- String title;
- DateTime startDate;
- String targetProduct;
- int rewards;
+ String? campaignID;
+ String? description;
+ String? businessID;
+ String? status;
+ String? title;
+ DateTime? startDate;
+ String? targetProduct;
+ int? rewards;
Campaign({
this.businessID,
diff --git a/lib/Classes/API Clasess/CommentsPost.dart b/lib/Classes/API Clasess/CommentsPost.dart
index be54b3c..079c630 100644
--- a/lib/Classes/API Clasess/CommentsPost.dart
+++ b/lib/Classes/API Clasess/CommentsPost.dart
@@ -1,9 +1,9 @@
class CommentsPost {
- String postId;
- String commentId;
- String comment;
- String timestamp;
- String commenterId;
+ String? postId;
+ String? commentId;
+ String? comment;
+ String? timestamp;
+ String? commenterId;
CommentsPost({
this.postId,
diff --git a/lib/Classes/API Clasess/CouponDetails.dart b/lib/Classes/API Clasess/CouponDetails.dart
index 8bc174e..70ac5c8 100644
--- a/lib/Classes/API Clasess/CouponDetails.dart
+++ b/lib/Classes/API Clasess/CouponDetails.dart
@@ -2,20 +2,20 @@ import 'TesoBusinessDetail.dart';
import 'Product.dart';
class CouponDetails {
- String couponId;
- String businessId;
- Product targetProduct;
- String type;
- int quantity;
- DateTime expiration;
- double worth;
- String state;
- TesoBusinessDetail issuer;
- double productCost;
- double lowerLimit;
- double upperLimit;
- String countID;
- String condition;
+ String? couponId;
+ String? businessId;
+ Product? targetProduct;
+ String? type;
+ int? quantity;
+ DateTime? expiration;
+ double? worth;
+ String? state;
+ TesoBusinessDetail? issuer;
+ double? productCost;
+ double? lowerLimit;
+ double? upperLimit;
+ String? countID;
+ String? condition;
CouponDetails(
{this.businessId,
@@ -54,7 +54,7 @@ class CouponDetails {
condition: json['condition'].toString());
} catch (e) {
print(e);
- return null;
+ return CouponDetails();
}
}
@@ -83,7 +83,7 @@ class CouponDetails {
data['businessId'] = this.businessId;
data['couponId'] = this.couponId;
data['target'] = this.targetProduct;
- data['expiration'] = this.expiration.toIso8601String();
+ data['expiration'] = this.expiration!.toIso8601String();
data['issuer'] = this.issuer;
data['productCost'] = this.productCost.toString();
data['quantity'] = this.quantity;
diff --git a/lib/Classes/API Clasess/CouponHead.dart b/lib/Classes/API Clasess/CouponHead.dart
index e46571f..c06388a 100644
--- a/lib/Classes/API Clasess/CouponHead.dart
+++ b/lib/Classes/API Clasess/CouponHead.dart
@@ -1,14 +1,14 @@
class CouponsHead {
- String couponId;
- String businessId;
- String targetProduct;
- String type;
- int quantity;
- DateTime expiration;
- double lower;
- double upper;
- String state;
- DateTime generated;
+ String? couponId;
+ String? businessId;
+ String? targetProduct;
+ String? type;
+ int? quantity;
+ DateTime? expiration;
+ double? lower;
+ double? upper;
+ String? state;
+ DateTime? generated;
CouponsHead(
{this.businessId,
@@ -34,13 +34,13 @@ class CouponsHead {
lower = double.parse((json['lower']).toString()),
upper = double.parse((json['upper']).toString());
- Map toJson() {
+ Map toJson() {
final Map data = Map();
data['businessID'] = this.businessId;
data['couponID'] = this.couponId;
- data['expiration'] = this.expiration.toIso8601String();
+ data['expiration'] = this.expiration!.toIso8601String();
data['generated'] = this.generated != null
- ? this.generated.toIso8601String()
+ ? this.generated!.toIso8601String()
: DateTime.now().toIso8601String();
data['quantity'] = this.quantity;
data['state'] = this.state;
diff --git a/lib/Classes/API Clasess/Desire.dart b/lib/Classes/API Clasess/Desire.dart
index 2b3682b..d69aca8 100644
--- a/lib/Classes/API Clasess/Desire.dart
+++ b/lib/Classes/API Clasess/Desire.dart
@@ -1,10 +1,10 @@
class Desire {
- String productName;
- String productID;
- String productImage;
- String enlisted;
- double price;
- String category;
+ String? productName;
+ String? productID;
+ String? productImage;
+ String? enlisted;
+ double? price;
+ String? category;
Desire(
{this.productName,
diff --git a/lib/Classes/API Clasess/ExploreObject.dart b/lib/Classes/API Clasess/ExploreObject.dart
index c879edb..a5933f8 100644
--- a/lib/Classes/API Clasess/ExploreObject.dart
+++ b/lib/Classes/API Clasess/ExploreObject.dart
@@ -1,8 +1,8 @@
import 'package:teso/Classes/API%20Clasess/Product.dart';
class ExploreClass {
- List trending;
- List latest;
+ List? trending;
+ List? latest;
ExploreClass({
this.trending,
diff --git a/lib/Classes/API Clasess/FacebookUser.dart b/lib/Classes/API Clasess/FacebookUser.dart
index 1f27787..0503324 100644
--- a/lib/Classes/API Clasess/FacebookUser.dart
+++ b/lib/Classes/API Clasess/FacebookUser.dart
@@ -1,14 +1,14 @@
class FacebookUser {
- String firstname;
- String surname;
- String email;
- String gender;
- String username;
- String userGUID;
- String country;
- String pictureUri;
- String deviceToken;
- String referralCode;
+ String? firstname;
+ String? surname;
+ String? email;
+ String? gender;
+ String? username;
+ String? userGUID;
+ String? country;
+ String? pictureUri;
+ String? deviceToken;
+ String? referralCode;
FacebookUser(
{this.firstname,
diff --git a/lib/Classes/API Clasess/GoogleUser.dart b/lib/Classes/API Clasess/GoogleUser.dart
index 63a653d..aea8872 100644
--- a/lib/Classes/API Clasess/GoogleUser.dart
+++ b/lib/Classes/API Clasess/GoogleUser.dart
@@ -1,14 +1,14 @@
class GoogleUser {
- String firstname;
- String surname;
- String email;
- String gender;
- String username;
- String userGUID;
- String country;
- String pictureUri;
- String deviceToken;
- String referralCode;
+ String? firstname;
+ String? surname;
+ String? email;
+ String? gender;
+ String? username;
+ String? userGUID;
+ String? country;
+ String? pictureUri;
+ String? deviceToken;
+ String? referralCode;
GoogleUser({
this.firstname,
diff --git a/lib/Classes/API Clasess/Post.dart b/lib/Classes/API Clasess/Post.dart
index c1d4af2..e1492c1 100644
--- a/lib/Classes/API Clasess/Post.dart
+++ b/lib/Classes/API Clasess/Post.dart
@@ -1,12 +1,12 @@
class Post {
- String postID;
- DateTime timestamp;
- String playbackID;
- String publisherID;
- String title;
- String assetID;
- String aspect;
- String rendition;
+ String? postID;
+ DateTime? timestamp;
+ String? playbackID;
+ String? publisherID;
+ String? title;
+ String? assetID;
+ String? aspect;
+ String? rendition;
Post({
this.postID,
@@ -36,7 +36,7 @@ class Post {
data['postId'] = this.postID;
data['playbackID'] = this.playbackID;
data['title'] = this.title;
- data['timestamp'] = this.timestamp.toIso8601String();
+ data['timestamp'] = this.timestamp!.toIso8601String();
data['assetID'] = this.assetID;
data['aspect'] = this.aspect;
data['rendition'] = this.rendition;
diff --git a/lib/Classes/API Clasess/PostFav.dart b/lib/Classes/API Clasess/PostFav.dart
index 8826ed9..3d55e1e 100644
--- a/lib/Classes/API Clasess/PostFav.dart
+++ b/lib/Classes/API Clasess/PostFav.dart
@@ -1,8 +1,8 @@
class PostFav {
- String postId;
- String admirerId;
- String timestamp;
- String countId;
+ String? postId;
+ String? admirerId;
+ String? timestamp;
+ String? countId;
PostFav({
this.postId,
diff --git a/lib/Classes/API Clasess/PostUpload.dart b/lib/Classes/API Clasess/PostUpload.dart
index 67f95b6..b644d27 100644
--- a/lib/Classes/API Clasess/PostUpload.dart
+++ b/lib/Classes/API Clasess/PostUpload.dart
@@ -1,9 +1,9 @@
class PostUpload {
- String title;
- String thumbnail;
- String aspect;
- String campaignID;
- String path;
+ String? title;
+ String? thumbnail;
+ String? aspect;
+ String? campaignID;
+ String? path;
PostUpload({
this.title,
diff --git a/lib/Classes/API Clasess/PostedAd.dart b/lib/Classes/API Clasess/PostedAd.dart
index a463380..561cc75 100644
--- a/lib/Classes/API Clasess/PostedAd.dart
+++ b/lib/Classes/API Clasess/PostedAd.dart
@@ -5,18 +5,18 @@ import 'package:teso/Classes/API%20Clasess/PostFav.dart';
import 'package:teso/Classes/TesoUser.dart';
class PostedAd {
- Post post;
- List likes;
- List comments;
- bool campaignAd;
- CampAd campAdvert;
- TesoUser publisher;
+ Post? post;
+ List? likes;
+ List? comments;
+ bool? campaignAd;
+ CampAd? campAdvert;
+ TesoUser? publisher;
PostedAd({
this.post,
this.likes,
this.comments,
- List friends,
+ List? friends,
this.campaignAd,
this.campAdvert,
this.publisher,
diff --git a/lib/Classes/API Clasess/PostionAP.dart b/lib/Classes/API Clasess/PostionAP.dart
index de6a2e7..f414056 100644
--- a/lib/Classes/API Clasess/PostionAP.dart
+++ b/lib/Classes/API Clasess/PostionAP.dart
@@ -1,6 +1,6 @@
class Position1 {
- double latitude;
- double longitude;
+ double? latitude;
+ double? longitude;
Position1({
this.latitude,
diff --git a/lib/Classes/API Clasess/Product.dart b/lib/Classes/API Clasess/Product.dart
index aa01850..16111dd 100644
--- a/lib/Classes/API Clasess/Product.dart
+++ b/lib/Classes/API Clasess/Product.dart
@@ -1,11 +1,11 @@
class Product {
- String productName;
- String businessID;
- String productDesc;
- String productID;
- String categoryID;
- double unitPrice;
- String productImage;
+ String? productName;
+ String? businessID;
+ String? productDesc;
+ String? productID;
+ String? categoryID;
+ double? unitPrice;
+ String? productImage;
Product(
{this.businessID,
diff --git a/lib/Classes/API Clasess/ProximityCoupon.dart b/lib/Classes/API Clasess/ProximityCoupon.dart
index be40af4..08f9d50 100644
--- a/lib/Classes/API Clasess/ProximityCoupon.dart
+++ b/lib/Classes/API Clasess/ProximityCoupon.dart
@@ -1,20 +1,20 @@
import 'TesoBusinessDetail.dart';
class ProximityCoupon {
- String couponId;
- TesoBusinessDetail business;
- String targetName;
- String targetID;
- String targetImage;
- double targetCost;
- String tagretDescription;
- String type;
- int quantity;
- DateTime expiration;
- double lowerLimit;
- double upperLimit;
- String state;
- String condition;
+ String? couponId;
+ TesoBusinessDetail? business;
+ String? targetName;
+ String? targetID;
+ String? targetImage;
+ double? targetCost;
+ String? tagretDescription;
+ String? type;
+ int? quantity;
+ DateTime? expiration;
+ double? lowerLimit;
+ double? upperLimit;
+ String? state;
+ String? condition;
ProximityCoupon({
this.business,
diff --git a/lib/Classes/API Clasess/ReferralClass.dart b/lib/Classes/API Clasess/ReferralClass.dart
index d1750b6..113fcfd 100644
--- a/lib/Classes/API Clasess/ReferralClass.dart
+++ b/lib/Classes/API Clasess/ReferralClass.dart
@@ -1,7 +1,7 @@
class ReferralClass {
- String referrer;
- String referred;
- bool reward;
+ String? referrer;
+ String? referred;
+ bool? reward;
ReferralClass({
this.referred,
diff --git a/lib/Classes/API Clasess/Registrar.dart b/lib/Classes/API Clasess/Registrar.dart
index 0198e03..c698d0a 100644
--- a/lib/Classes/API Clasess/Registrar.dart
+++ b/lib/Classes/API Clasess/Registrar.dart
@@ -2,9 +2,9 @@ import 'package:teso/Classes/API%20Clasess/TesoUserDetail.dart';
import 'package:teso/Classes/API%20Clasess/UserAuth.dart';
class Registrar {
- UserAuth authentication;
- TesoUserDetail user;
- String referral;
+ UserAuth? authentication;
+ TesoUserDetail? user;
+ String? referral;
Registrar({
this.authentication,
this.user,
diff --git a/lib/Classes/API Clasess/ResetClass.dart b/lib/Classes/API Clasess/ResetClass.dart
index bafec46..68d680e 100644
--- a/lib/Classes/API Clasess/ResetClass.dart
+++ b/lib/Classes/API Clasess/ResetClass.dart
@@ -1,7 +1,7 @@
class ResetClass {
- String password;
- String resetGuid;
- String resetcode;
+ String? password;
+ String? resetGuid;
+ String? resetcode;
ResetClass({
this.password,
diff --git a/lib/Classes/API Clasess/SilverPurchaseRequest.dart b/lib/Classes/API Clasess/SilverPurchaseRequest.dart
index 4bac07c..1bfeb03 100644
--- a/lib/Classes/API Clasess/SilverPurchaseRequest.dart
+++ b/lib/Classes/API Clasess/SilverPurchaseRequest.dart
@@ -1,7 +1,7 @@
class SilverPurchaseRequest {
- int coinamount;
- String method;
- double amount;
+ int? coinamount;
+ String? method;
+ double? amount;
SilverPurchaseRequest({
this.coinamount,
diff --git a/lib/Classes/API Clasess/TesoBusinessDetail.dart b/lib/Classes/API Clasess/TesoBusinessDetail.dart
index d8d016d..72275e0 100644
--- a/lib/Classes/API Clasess/TesoBusinessDetail.dart
+++ b/lib/Classes/API Clasess/TesoBusinessDetail.dart
@@ -1,17 +1,17 @@
class TesoBusinessDetail {
- String businessId;
- String handle;
- String businessName;
- String businessTin;
- String businessDescription;
- String businessCategory;
- String businessAddress;
- String businessContact;
- String businessLogo;
- DateTime dateOfEst;
- String businessEmail;
- String businessLat;
- String businessLng;
+ String? businessId;
+ String? handle;
+ String? businessName;
+ String? businessTin;
+ String? businessDescription;
+ String? businessCategory;
+ String? businessAddress;
+ String? businessContact;
+ String? businessLogo;
+ DateTime? dateOfEst;
+ String? businessEmail;
+ String? businessLat;
+ String? businessLng;
TesoBusinessDetail(
{this.businessId,
@@ -56,7 +56,7 @@ class TesoBusinessDetail {
data['businessLogo'] = this.businessLogo;
data['businessName'] = this.businessName;
data['businessTin'] = this.businessTin;
- data['dateOfEst'] = this.dateOfEst.toIso8601String();
+ data['dateOfEst'] = this.dateOfEst!.toIso8601String();
data['handle'] = this.handle;
return data;
}
diff --git a/lib/Classes/API Clasess/TesoUserDetail.dart b/lib/Classes/API Clasess/TesoUserDetail.dart
index bb98e11..63b3080 100644
--- a/lib/Classes/API Clasess/TesoUserDetail.dart
+++ b/lib/Classes/API Clasess/TesoUserDetail.dart
@@ -1,18 +1,18 @@
import 'package:teso/Classes/TesoUser.dart';
class TesoUserDetail {
- String userGUID;
- String username;
- String firstname;
- String surname;
- String description;
- String address;
- String email;
- String thumbnailDp;
- String phonenumber;
- String country;
- String gender;
- DateTime dateOfBirth;
+ String? userGUID;
+ String? username;
+ String? firstname;
+ String? surname;
+ String? description;
+ String? address;
+ String? email;
+ String? thumbnailDp;
+ String? phonenumber;
+ String? country;
+ String? gender;
+ DateTime? dateOfBirth;
TesoUserDetail(
{this.username,
@@ -65,7 +65,7 @@ class TesoUserDetail {
data['description'] = this.description;
data['address'] = this.address;
data['phonenumber'] = this.phonenumber;
- data['dateOfBirth'] = this.dateOfBirth.toIso8601String();
+ data['dateOfBirth'] = this.dateOfBirth!.toIso8601String();
data['thumbnailDp'] = this.thumbnailDp;
data['email'] = this.email;
data['gender'] = this.gender;
diff --git a/lib/Classes/API Clasess/ThirdPerson.dart b/lib/Classes/API Clasess/ThirdPerson.dart
index ebe56b3..b16b23c 100644
--- a/lib/Classes/API Clasess/ThirdPerson.dart
+++ b/lib/Classes/API Clasess/ThirdPerson.dart
@@ -1,12 +1,14 @@
+// ignore_for_file: unnecessary_null_comparison
+
import 'package:teso/Classes/TesoUser.dart';
import 'Post.dart';
class ThirdPerson {
- TesoUser user;
- List posts = [];
- List following = [];
- List friends = [];
- String relation;
+ TesoUser? user;
+ List? posts = [];
+ List? following = [];
+ List? friends = [];
+ String? relation;
ThirdPerson({
this.user,
@@ -22,8 +24,8 @@ class ThirdPerson {
return ThirdPerson(
user: json["user"] != null ? TesoUser.fromJSON(json["user"]) : null,
posts: adverts != null ? adverts : [],
- following: json["following"] as List,
- friends: json["friends"] as List,
+ following: json["following"] as List?,
+ friends: json["friends"] as List?,
relation: json["relation"],
);
}
diff --git a/lib/Classes/API Clasess/TokenHandler.dart b/lib/Classes/API Clasess/TokenHandler.dart
index 1e511b8..ca0bbbf 100644
--- a/lib/Classes/API Clasess/TokenHandler.dart
+++ b/lib/Classes/API Clasess/TokenHandler.dart
@@ -1,9 +1,9 @@
import 'package:teso/Classes/TesoUser.dart';
class TokenHandler {
- String tokenTeso;
- String tokenFirebase;
- TesoUser user;
+ String? tokenTeso;
+ String? tokenFirebase;
+ TesoUser? user;
TokenHandler({this.tokenTeso, this.user, this.tokenFirebase});
diff --git a/lib/Classes/API Clasess/TwitterUser.dart b/lib/Classes/API Clasess/TwitterUser.dart
index 9badd07..fe01574 100644
--- a/lib/Classes/API Clasess/TwitterUser.dart
+++ b/lib/Classes/API Clasess/TwitterUser.dart
@@ -1,14 +1,14 @@
class TwitterUser {
- String firstname;
- String surname;
- String email;
- String gender;
- String username;
- String userGUID;
- String country;
- String pictureUri;
- String deviceToken;
- String referralCode;
+ String? firstname;
+ String? surname;
+ String? email;
+ String? gender;
+ String? username;
+ String? userGUID;
+ String? country;
+ String? pictureUri;
+ String? deviceToken;
+ String? referralCode;
TwitterUser(
{this.firstname,
diff --git a/lib/Classes/API Clasess/UserAuth.dart b/lib/Classes/API Clasess/UserAuth.dart
index d935568..5225f0e 100644
--- a/lib/Classes/API Clasess/UserAuth.dart
+++ b/lib/Classes/API Clasess/UserAuth.dart
@@ -1,10 +1,10 @@
class UserAuth {
- String username;
- String password;
- String accountType;
- String status;
- String deviceToken;
- String referralCode;
+ String? username;
+ String? password;
+ String? accountType;
+ String? status;
+ String? deviceToken;
+ String? referralCode;
UserAuth({
this.username,
this.password,
diff --git a/lib/Classes/API Clasess/UserFavCategory.dart b/lib/Classes/API Clasess/UserFavCategory.dart
index 6a2a014..633947b 100644
--- a/lib/Classes/API Clasess/UserFavCategory.dart
+++ b/lib/Classes/API Clasess/UserFavCategory.dart
@@ -1,7 +1,7 @@
class UserFavCategory {
- String userGuid;
- String categoryCode;
- String countID;
+ String? userGuid;
+ String? categoryCode;
+ String? countID;
UserFavCategory({
this.userGuid,
diff --git a/lib/Classes/API Clasess/UserFinance.dart b/lib/Classes/API Clasess/UserFinance.dart
index 2feadd9..06d9761 100644
--- a/lib/Classes/API Clasess/UserFinance.dart
+++ b/lib/Classes/API Clasess/UserFinance.dart
@@ -1,7 +1,7 @@
class UserFinance {
- String userGUID;
- int gold;
- int silver;
+ String? userGUID;
+ int? gold;
+ int? silver;
UserFinance({
this.userGUID,
diff --git a/lib/Classes/ChatMessage.dart b/lib/Classes/ChatMessage.dart
index 9efe4fb..abf8e21 100644
--- a/lib/Classes/ChatMessage.dart
+++ b/lib/Classes/ChatMessage.dart
@@ -1,9 +1,9 @@
class ChatMessage {
- String idFrom;
- String idTo;
- String content;
- int type;
- DateTime timestamp;
+ String? idFrom;
+ String? idTo;
+ String? content;
+ int? type;
+ DateTime? timestamp;
ChatMessage({
this.idFrom,
diff --git a/lib/Classes/ColorFilters.dart b/lib/Classes/ColorFilters.dart
index 776a3f8..baf8463 100644
--- a/lib/Classes/ColorFilters.dart
+++ b/lib/Classes/ColorFilters.dart
@@ -1,8 +1,8 @@
import 'package:flutter/painting.dart';
class ColorFilter {
- Color code;
- String name;
+ Color? code;
+ String? name;
ColorFilter({
this.code,
this.name,
diff --git a/lib/Classes/Connection.dart b/lib/Classes/Connection.dart
index 44dc966..a51236a 100644
--- a/lib/Classes/Connection.dart
+++ b/lib/Classes/Connection.dart
@@ -31,7 +31,7 @@ class MyConnectivity {
SharedPreferences prefs = await SharedPreferences.getInstance();
Map requestHeaders = {
// 'Content-type': 'application/json',
- 'Authorization': prefs.getString("tokensTeso")
+ 'Authorization': prefs.getString("tokensTeso")!
};
var register2 = serverLocation + 'serverstatus';
var client1 = await http
diff --git a/lib/Classes/Firebase/Comments.dart b/lib/Classes/Firebase/Comments.dart
index 8a81d80..7badeec 100644
--- a/lib/Classes/Firebase/Comments.dart
+++ b/lib/Classes/Firebase/Comments.dart
@@ -1,11 +1,11 @@
class FBComments {
- String postID;
- DateTime timestamp;
- String thumbnail;
- String commenterID;
- String commenter;
- String commentID;
- String comment;
+ String? postID;
+ DateTime? timestamp;
+ String? thumbnail;
+ String? commenterID;
+ String? commenter;
+ String? commentID;
+ String? comment;
FBComments(
{this.postID,
diff --git a/lib/Classes/Firebase/Posts.dart b/lib/Classes/Firebase/Posts.dart
index 6643953..08a43ff 100644
--- a/lib/Classes/Firebase/Posts.dart
+++ b/lib/Classes/Firebase/Posts.dart
@@ -1,15 +1,15 @@
class FBPosts {
- String postID;
- DateTime timestamp;
- String playbackID;
- String publisherID;
- String title;
- String assetID;
- String rendition;
- String aspect;
- String campaignID;
- int likes;
- int comments;
+ String? postID;
+ DateTime? timestamp;
+ String? playbackID;
+ String? publisherID;
+ String? title;
+ String? assetID;
+ String? rendition;
+ String? aspect;
+ String? campaignID;
+ int? likes;
+ int? comments;
FBPosts(
{this.postID,
diff --git a/lib/Classes/NotificationSpliter.dart b/lib/Classes/NotificationSpliter.dart
index 880f700..75e1977 100644
--- a/lib/Classes/NotificationSpliter.dart
+++ b/lib/Classes/NotificationSpliter.dart
@@ -14,38 +14,31 @@ class NotificationSplitter {
payload.load2 = data["firstname"];
payload.load3 = data["surname"];
return payload;
- break;
case "likes":
payload.loadID = "TESN000";
payload.load1 = data["post"];
return payload;
- break;
case "comments":
payload.loadID = "TESN000";
payload.load1 = data["post"];
return payload;
- break;
case "friendapproval":
Provider.of(context, listen: false).loadFriends();
payload.loadID = "TESN000";
return payload;
- break;
case "friendrequest":
payload.loadID = "TESN000";
return payload;
- break;
case "gifted":
Provider.of(context, listen: false).getCoupons();
payload.loadID = "TESN000";
payload.load1 = data["couponID"];
return payload;
- break;
case "cancellation":
Provider.of(context, listen: false).getCoupons();
payload.loadID = "TESN000";
payload.load1 = data["couponID"];
return payload;
- break;
case "personalized":
payload.loadID = "TESN000";
payload.load1 = data["coupon"];
@@ -56,7 +49,6 @@ class NotificationSplitter {
payload.load6 = data["originalPrice"];
payload.load7 = data["productName"];
return payload;
- break;
case "campaign":
var coup = jsonDecode(data["campaign"]);
payload.loadID = "TESN005";
@@ -69,33 +61,27 @@ class NotificationSplitter {
payload.load7 = coup["goldReward"].toString();
payload.load8 = coup["startDate"].toString();
return payload;
- break;
case "reward":
payload.loadID = "TESN0R0";
return payload;
- break;
case "expired":
Provider.of(context, listen: false).getCoupons();
payload.loadID = "TESN000";
payload.load1 = data["couponID"];
return payload;
- break;
case "refund":
Provider.of(context, listen: false).getUserInformation();
payload.loadID = "TESN000";
payload.load1 = data["couponID"];
return payload;
- break;
case "coinpurchase":
Provider.of(context, listen: false).getUserInformation();
payload.loadID = "TESN000";
payload.load1 = data["orderID"];
await closeInAppWebView();
return payload;
- break;
default:
return payload;
- break;
}
}
}
diff --git a/lib/Classes/Payload.dart b/lib/Classes/Payload.dart
index e3e2b60..a340a6d 100644
--- a/lib/Classes/Payload.dart
+++ b/lib/Classes/Payload.dart
@@ -1,15 +1,15 @@
class Payload {
- String loadID;
- String load1;
- String load2;
- String load3;
- String load4;
- String load5;
- String load6;
- String load7;
- String load8;
- String load9;
- String load10;
+ String? loadID;
+ String? load1;
+ String? load2;
+ String? load3;
+ String? load4;
+ String? load5;
+ String? load6;
+ String? load7;
+ String? load8;
+ String? load9;
+ String? load10;
Payload({
this.load1,
diff --git a/lib/Classes/Product.dart b/lib/Classes/Product.dart
index 4163880..2a9ebbe 100644
--- a/lib/Classes/Product.dart
+++ b/lib/Classes/Product.dart
@@ -1,12 +1,12 @@
class Product {
- String itemID;
- String name;
- String shopName;
- String shopLocation;
- String country;
- String duration;
- String adShort;
- String adFull;
+ String? itemID;
+ String? name;
+ String? shopName;
+ String? shopLocation;
+ String? country;
+ String? duration;
+ String? adShort;
+ String? adFull;
Product(
{this.itemID,
diff --git a/lib/Classes/QRClass.dart b/lib/Classes/QRClass.dart
index d2ab12c..09b7f69 100644
--- a/lib/Classes/QRClass.dart
+++ b/lib/Classes/QRClass.dart
@@ -1,7 +1,7 @@
class QRClass {
- String code;
- String type;
- List rawBytes;
+ String? code;
+ String? type;
+ List? rawBytes;
QRClass({
this.code,
diff --git a/lib/Classes/ReportedContent.dart b/lib/Classes/ReportedContent.dart
index 4ba572c..e5f5a38 100644
--- a/lib/Classes/ReportedContent.dart
+++ b/lib/Classes/ReportedContent.dart
@@ -1,11 +1,11 @@
import 'dart:core';
class ReportedContent {
- String userGuid;
- String postID;
- String publisherID;
- DateTime timestamp;
- int report;
+ String? userGuid;
+ String? postID;
+ String? publisherID;
+ DateTime? timestamp;
+ int? report;
ReportedContent(
{this.postID,
diff --git a/lib/Classes/TesoShop.dart b/lib/Classes/TesoShop.dart
index 0135843..76851bb 100644
--- a/lib/Classes/TesoShop.dart
+++ b/lib/Classes/TesoShop.dart
@@ -1,17 +1,17 @@
class TesoShop {
- String shopID;
- String shopName;
- String shopTin;
- String shopAddress;
- double latitude;
- double longitude;
- String shopPhone;
- DateTime dateEst;
- String handle;
- String categoryShop;
- String shopDescription;
- String logo;
- String email;
+ String? shopID;
+ String? shopName;
+ String? shopTin;
+ String? shopAddress;
+ double? latitude;
+ double? longitude;
+ String? shopPhone;
+ DateTime? dateEst;
+ String? handle;
+ String? categoryShop;
+ String? shopDescription;
+ String? logo;
+ String? email;
TesoShop(
{this.shopID,
diff --git a/lib/Classes/TesoUser.dart b/lib/Classes/TesoUser.dart
index 30ce1c4..19cb63a 100644
--- a/lib/Classes/TesoUser.dart
+++ b/lib/Classes/TesoUser.dart
@@ -1,23 +1,23 @@
import 'API Clasess/TesoUserDetail.dart';
class TesoUser {
- String userGUID;
- String username;
- String firstname;
- String lastname;
- String description;
- String email;
- String phonenumber;
- String address;
- String displaypicture;
- DateTime dateOfBirth;
+ String? userGUID;
+ String? username;
+ String? firstname;
+ String? lastname;
+ String? description;
+ String? email;
+ String? phonenumber;
+ String? address;
+ String? displaypicture;
+ DateTime? dateOfBirth;
// ignore: non_constant_identifier_names
- String thumbnail_dp;
- String gold;
- String silver;
- String friends;
- String gender;
- String country;
+ String? thumbnail_dp;
+ String? gold;
+ String? silver;
+ String? friends;
+ String? gender;
+ String? country;
TesoUser(
{this.userGUID,
@@ -66,7 +66,7 @@ class TesoUser {
data['lastname'] = this.lastname;
data['description'] = this.description;
data['address'] = this.address;
- data["dateOfBirth"] = this.dateOfBirth.toIso8601String();
+ data["dateOfBirth"] = this.dateOfBirth!.toIso8601String();
data['phonenumber'] = this.phonenumber;
data['thumbnail_dp'] = this.thumbnail_dp;
data['email'] = this.email;
diff --git a/lib/Classes/TextE.dart b/lib/Classes/TextE.dart
index a3ec81f..5108d87 100644
--- a/lib/Classes/TextE.dart
+++ b/lib/Classes/TextE.dart
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
class Textted {
- String text;
- TextStyle textStyle;
- TextAlign textAlign;
+ String? text;
+ TextStyle? textStyle;
+ TextAlign? textAlign;
Textted({
this.text,
diff --git a/lib/Classes/categories.dart b/lib/Classes/categories.dart
index cb2bf2e..c1541ff 100644
--- a/lib/Classes/categories.dart
+++ b/lib/Classes/categories.dart
@@ -1,7 +1,7 @@
class Category {
- String id;
- String name;
- String image;
+ String? id;
+ String? name;
+ String? image;
Category({this.id, this.name, this.image});
Category.fromJson(Map json)
: id = json['catid'],
diff --git a/lib/Classes/customLoginButton.dart b/lib/Classes/customLoginButton.dart
index 912f277..41763b4 100644
--- a/lib/Classes/customLoginButton.dart
+++ b/lib/Classes/customLoginButton.dart
@@ -4,13 +4,13 @@ class CustomLoginButton extends StatelessWidget {
final Widget child;
final double width;
final double height;
- final Function onPressed;
- final String icon;
- final Color color;
+ final Function? onPressed;
+ final String? icon;
+ final Color? color;
const CustomLoginButton({
- Key key,
- @required this.child,
+ Key? key,
+ required this.child,
this.width = double.infinity,
this.height = 50.0,
this.onPressed,
@@ -67,12 +67,12 @@ class CustomLoginButton extends StatelessWidget {
),
),
child: InkWell(
- onTap: onPressed,
+ onTap: onPressed as void Function()?,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Image(
- image: AssetImage(icon),
+ image: AssetImage(icon!),
height: 20,
),
child
diff --git a/lib/Classes/customTesoButton.dart b/lib/Classes/customTesoButton.dart
index 5f2c3da..fb7e050 100644
--- a/lib/Classes/customTesoButton.dart
+++ b/lib/Classes/customTesoButton.dart
@@ -2,14 +2,14 @@ import 'package:flutter/material.dart';
class RaisedGradientButton extends StatelessWidget {
final Widget child;
- final Gradient gradient;
+ final Gradient? gradient;
final double width;
final double height;
- final Function onPressed;
+ final Function? onPressed;
const RaisedGradientButton({
- Key key,
- @required this.child,
+ Key? key,
+ required this.child,
this.gradient,
this.width = double.infinity,
this.height = 50.0,
@@ -30,7 +30,7 @@ class RaisedGradientButton extends StatelessWidget {
height: 40.0,
decoration: BoxDecoration(gradient: gradient, boxShadow: [
BoxShadow(
- color: Colors.grey[500],
+ color: Colors.grey[500]!,
offset: Offset(0.0, 1.5),
blurRadius: 1.5,
),
@@ -43,7 +43,7 @@ class RaisedGradientButton extends StatelessWidget {
),
color: Colors.transparent,
child: InkWell(
- onTap: onPressed,
+ onTap: onPressed as void Function()?,
child: Center(
child: child,
)),
diff --git a/lib/Classes/friend.dart b/lib/Classes/friend.dart
index d88b00f..1855bd4 100644
--- a/lib/Classes/friend.dart
+++ b/lib/Classes/friend.dart
@@ -1,13 +1,13 @@
class Friend {
- String userID;
- String firstname;
- String surname;
- String dateOfBirth;
- String thumbnail;
- String description;
- String posts;
- String following;
- String friendsNum;
+ String? userID;
+ String? firstname;
+ String? surname;
+ String? dateOfBirth;
+ String? thumbnail;
+ String? description;
+ String? posts;
+ String? following;
+ String? friendsNum;
Friend(
{this.userID,
diff --git a/lib/Classes/inbox.dart b/lib/Classes/inbox.dart
index ac54a87..71b2123 100644
--- a/lib/Classes/inbox.dart
+++ b/lib/Classes/inbox.dart
@@ -1,13 +1,13 @@
class InboxMessage {
- String userID;
- String firstname;
- String surname;
- String messageID;
- String message;
- String thumbnail;
- String bio;
- DateTime timestamp;
- int unread;
+ String? userID;
+ String? firstname;
+ String? surname;
+ String? messageID;
+ String? message;
+ String? thumbnail;
+ String? bio;
+ DateTime? timestamp;
+ int? unread;
InboxMessage(
{this.userID,
diff --git a/lib/Notifications/NotificationPlugin.dart b/lib/Notifications/NotificationPlugin.dart
index 4d6119d..ef2c8a2 100644
--- a/lib/Notifications/NotificationPlugin.dart
+++ b/lib/Notifications/NotificationPlugin.dart
@@ -8,11 +8,11 @@ import 'package:rxdart/subjects.dart';
class NotificationPlugin {
//
- FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
+ late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
final BehaviorSubject
didReceivedLocalNotificationSubject =
BehaviorSubject();
- var initializationSettings;
+ late var initializationSettings;
NotificationPlugin._() {
init();
@@ -48,7 +48,7 @@ class NotificationPlugin {
_requestIOSPermission() {
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
- IOSFlutterLocalNotificationsPlugin>()
+ IOSFlutterLocalNotificationsPlugin>()!
.requestPermissions(
alert: true,
badge: true,
@@ -64,13 +64,13 @@ class NotificationPlugin {
setOnNotificationClick(Function onNotificationClick) async {
await flutterLocalNotificationsPlugin.initialize(initializationSettings,
- onSelectNotification: (String payload) async {
+ onSelectNotification: (String? payload) async {
onNotificationClick(payload);
});
}
Future showNotification(
- String title, String body, String payload) async {
+ String? title, String? body, String payload) async {
var androidChannelSpecifics = AndroidNotificationDetails(
'CHANNEL_ID',
'CHANNEL_NAME',
@@ -258,14 +258,14 @@ NotificationPlugin notificationPlugin = NotificationPlugin._();
class ReceivedNotification {
final int id;
- final String title;
- final String body;
- final String payload;
+ final String? title;
+ final String? body;
+ final String? payload;
ReceivedNotification({
- @required this.id,
- @required this.title,
- @required this.body,
- @required this.payload,
+ required this.id,
+ required this.title,
+ required this.body,
+ required this.payload,
});
}
diff --git a/lib/Pages/BusinessLocator.dart b/lib/Pages/BusinessLocator.dart
index 1710190..c195ef0 100644
--- a/lib/Pages/BusinessLocator.dart
+++ b/lib/Pages/BusinessLocator.dart
@@ -23,27 +23,27 @@ class BusinessLocator extends StatefulWidget {
}
class _BusinessLocatorState extends State {
- String mapstyle;
+ String? mapstyle;
var _future;
- static LatLng _initialPosition;
+ static LatLng? _initialPosition;
Set markers = {};
- List shops;
- GoogleMapController mapController;
+ List? shops;
+ GoogleMapController? mapController;
static const double CAMERA_ZOOM = 13.499910354614258;
bool routing = false;
List polylineCoordinates = [];
Map polylines = {};
- String selectedshop = "";
+ String? selectedshop = "";
Location location = Location();
String routingMessage = "Finding shops....";
- LocationData _location;
- String _error;
- String _placeDistance;
+ late LocationData _location;
+ String? _error;
+ String? _placeDistance;
final startAddressController = TextEditingController();
final destinationAddressController = TextEditingController();
bool ios = false;
- Future _determinePosition(context) async {
+ Future _determinePosition(context) async {
setState(() {
_error = null;
});
@@ -51,7 +51,7 @@ class _BusinessLocatorState extends State {
final LocationData _locationResult = await location.getLocation();
setState(() {
_location = _locationResult;
- _initialPosition = LatLng(_location.latitude, _location.longitude);
+ _initialPosition = LatLng(_location.latitude!, _location.longitude!);
});
await getLocations();
@@ -68,7 +68,7 @@ class _BusinessLocatorState extends State {
SharedPreferences prefs = await SharedPreferences.getInstance();
Map requestHeaders = {
'Content-type': 'application/json',
- 'Authorization': prefs.getString('tokensTeso')
+ 'Authorization': prefs.getString('tokensTeso')!
};
var register2 = serverLocation + 'tesobusiness/available';
@@ -84,12 +84,12 @@ class _BusinessLocatorState extends State {
}
}
- if (shops.length > 0 && shops != null)
- shops.forEach((element) {
- MarkerId markerId = MarkerId(element.shopID);
+ if (shops!.length > 0 && shops != null)
+ shops!.forEach((element) {
+ MarkerId markerId = MarkerId(element.shopID!);
Marker marker = Marker(
markerId: markerId,
- position: LatLng(element.latitude, element.longitude),
+ position: LatLng(element.latitude!, element.longitude!),
icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueCyan),
infoWindow: InfoWindow(
title: element.shopName,
@@ -118,7 +118,7 @@ class _BusinessLocatorState extends State {
super.initState();
ios = Platform.isIOS;
SharedPreferences.getInstance().then((prefs) {
- String currentTheme = prefs.getString("theme");
+ String? currentTheme = prefs.getString("theme");
if (currentTheme == "light") {
rootBundle.loadString('assets/styles/light.txt').then((string) {
mapstyle = string;
@@ -132,7 +132,7 @@ class _BusinessLocatorState extends State {
_future = _determinePosition(context);
location.onLocationChanged.listen((LocationData cLoc) {
- _initialPosition = LatLng(cLoc.latitude, cLoc.longitude);
+ _initialPosition = LatLng(cLoc.latitude!, cLoc.longitude!);
});
}
@@ -140,10 +140,10 @@ class _BusinessLocatorState extends State {
Position _northeastCoordinates;
Position _southwestCoordinates;
- MarkerId markerId = MarkerId(tesoShop.shopName + " Location");
+ MarkerId markerId = MarkerId(tesoShop.shopName! + " Location");
Marker marker = Marker(
markerId: markerId,
- position: LatLng(tesoShop.latitude, tesoShop.longitude),
+ position: LatLng(tesoShop.latitude!, tesoShop.longitude!),
icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen),
infoWindow: InfoWindow(
title: tesoShop.shopName,
@@ -155,12 +155,12 @@ class _BusinessLocatorState extends State {
markers.clear();
markers.add(marker);
selectedshop = tesoShop.shopName;
- destinationAddressController.text = selectedshop;
+ destinationAddressController.text = selectedshop!;
});
Position user = Position(
- latitude: _initialPosition.latitude,
- longitude: _initialPosition.longitude,
+ latitude: _initialPosition!.latitude,
+ longitude: _initialPosition!.longitude,
accuracy: 100,
altitude: 100,
heading: 100,
@@ -168,8 +168,8 @@ class _BusinessLocatorState extends State {
speedAccuracy: 100,
timestamp: DateTime.now());
Position shopLoc = Position(
- latitude: tesoShop.latitude,
- longitude: tesoShop.longitude,
+ latitude: tesoShop.latitude!,
+ longitude: tesoShop.longitude!,
accuracy: 100,
altitude: 100,
heading: 100,
@@ -177,7 +177,7 @@ class _BusinessLocatorState extends State {
speedAccuracy: 100,
timestamp: DateTime.now());
- if (_initialPosition.latitude <= tesoShop.latitude) {
+ if (_initialPosition!.latitude <= tesoShop.latitude!) {
_southwestCoordinates = user;
_northeastCoordinates = shopLoc;
} else {
@@ -187,7 +187,7 @@ class _BusinessLocatorState extends State {
await createPolylines(user, shopLoc);
_calculateDistance(user, shopLoc);
- mapController.animateCamera(
+ mapController!.animateCamera(
CameraUpdate.newLatLngBounds(
LatLngBounds(
northeast: LatLng(
@@ -248,7 +248,7 @@ class _BusinessLocatorState extends State {
@override
void dispose() {
- if (mapController != null) mapController.dispose();
+ if (mapController != null) mapController!.dispose();
super.dispose();
}
@@ -329,7 +329,7 @@ class _BusinessLocatorState extends State {
myLocationEnabled: true,
markers: markers,
initialCameraPosition: CameraPosition(
- target: _initialPosition,
+ target: _initialPosition!,
zoom: CAMERA_ZOOM,
//bearing: CAMERA_BEARING,
),
@@ -377,7 +377,7 @@ class _BusinessLocatorState extends State {
),
),
Visibility(
- visible: selectedshop == null || selectedshop.isEmpty
+ visible: selectedshop == null || selectedshop!.isEmpty
? false
: true,
child: Align(
@@ -489,7 +489,7 @@ class _BusinessLocatorState extends State {
double _coordinateDistance(lat1, lon1, lat2, lon2) {
var p = 0.017453292519943295;
- var c = cos;
+ var c = cos as double Function(num?);
var a = 0.5 -
c((lat2 - lat1) * p) / 2 +
c(lat1 * p) * c(lat2 * p) * (1 - c((lon2 - lon1) * p)) / 2;
@@ -522,7 +522,7 @@ class _BusinessLocatorState extends State {
// Accommodate the two locations within the
// camera view of the map
- mapController.animateCamera(
+ mapController!.animateCamera(
CameraUpdate.newLatLngBounds(
LatLngBounds(
northeast: LatLng(northEastLatitude, northEastLongitude),
@@ -569,13 +569,13 @@ class _BusinessLocatorState extends State {
}
Widget _textField({
- TextEditingController controller,
- FocusNode focusNode,
- String label,
- String hint,
- double width,
- Icon prefixIcon,
- Widget suffixIcon,
+ TextEditingController? controller,
+ FocusNode? focusNode,
+ String? label,
+ String? hint,
+ required double width,
+ Icon? prefixIcon,
+ Widget? suffixIcon,
}) {
return Container(
width: width * 0.8,
diff --git a/lib/Pages/DesireComeTrue.dart b/lib/Pages/DesireComeTrue.dart
index a57b935..e6dbd6d 100644
--- a/lib/Pages/DesireComeTrue.dart
+++ b/lib/Pages/DesireComeTrue.dart
@@ -17,8 +17,8 @@ class DesireComeTrue extends StatefulWidget {
class _DesireComeTrueState extends State
with TickerProviderStateMixin {
- AnimationController _controller;
- Animation _fabScale;
+ late AnimationController _controller;
+ late Animation _fabScale;
List desires = [];
@override
@@ -35,9 +35,9 @@ class _DesireComeTrueState extends State
});
SharedPreferences.getInstance().then((value) {
var jiffy = Jiffy()..add(months: 1);
- if (value.getString("desire" + jiffy.format("MMMM, yyyy")).isNotEmpty) {
+ if (value.getString("desire" + jiffy.format("MMMM, yyyy"))!.isNotEmpty) {
var desired =
- jsonDecode(value.getString("desire" + jiffy.format("MMMM, yyyy")));
+ jsonDecode(value.getString("desire" + jiffy.format("MMMM, yyyy"))!);
setState(() {
desires = List.from(
desired.map((model) => Desire.fromJSON(model)).toList());
@@ -53,7 +53,7 @@ class _DesireComeTrueState extends State
SharedPreferences prefs = await SharedPreferences.getInstance();
Map requestHeaders = {
'Content-type': 'application/json',
- 'Authorization': prefs.getString('tokensTeso')
+ 'Authorization': prefs.getString('tokensTeso')!
};
var register2 = serverLocation + 'monthly-desires/submit-newdesire';
diff --git a/lib/Pages/LandingPage.dart b/lib/Pages/LandingPage.dart
index 9a59be8..9083997 100644
--- a/lib/Pages/LandingPage.dart
+++ b/lib/Pages/LandingPage.dart
@@ -14,9 +14,9 @@ import 'package:teso/util/consts.dart';
import 'PageWidgets/Settings/terms.dart';
class LandingPage extends StatefulWidget {
- final List connectedCameras;
+ final List? connectedCameras;
- const LandingPage({Key key, this.connectedCameras}) : super(key: key);
+ const LandingPage({Key? key, this.connectedCameras}) : super(key: key);
@override
_LandingPageState createState() => _LandingPageState();
}
diff --git a/lib/Pages/PageWidgets/Alerts/AlertTile.dart b/lib/Pages/PageWidgets/Alerts/AlertTile.dart
index 44c04a0..0a64379 100644
--- a/lib/Pages/PageWidgets/Alerts/AlertTile.dart
+++ b/lib/Pages/PageWidgets/Alerts/AlertTile.dart
@@ -4,12 +4,12 @@ import 'package:teso/util/consts.dart';
import 'package:time_elapsed/time_elapsed.dart';
buildAlert(
- {BuildContext context,
- DateTime timestamp,
- String description,
- Icon icons,
- String thumbnail,
- String username}) {
+ {required BuildContext context,
+ required DateTime timestamp,
+ required String description,
+ Icon? icons,
+ String? thumbnail,
+ String? username}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Material(
@@ -85,7 +85,7 @@ buildAlert(
color: Color.fromRGBO(0, 0, 0, 0.4),
child: Center(
child: Text(
- username.characters
+ username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
diff --git a/lib/Pages/PageWidgets/Alerts/Redeemable.dart b/lib/Pages/PageWidgets/Alerts/Redeemable.dart
index 18f790d..f178eb8 100644
--- a/lib/Pages/PageWidgets/Alerts/Redeemable.dart
+++ b/lib/Pages/PageWidgets/Alerts/Redeemable.dart
@@ -6,11 +6,11 @@ import 'package:teso/util/consts.dart';
import 'package:time_elapsed/time_elapsed.dart';
buildRedeemableAlert(
- {BuildContext context,
- DateTime timestamp,
- Icon icons,
- String thumbnail,
- String message}) {
+ {required BuildContext context,
+ required DateTime timestamp,
+ Icon? icons,
+ required String thumbnail,
+ required String message}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0),
child: Material(
diff --git a/lib/Pages/PageWidgets/Alerts/Refund.dart b/lib/Pages/PageWidgets/Alerts/Refund.dart
index c7b8a6b..fd63057 100644
--- a/lib/Pages/PageWidgets/Alerts/Refund.dart
+++ b/lib/Pages/PageWidgets/Alerts/Refund.dart
@@ -5,7 +5,7 @@ import 'package:teso/util/consts.dart';
import 'package:time_elapsed/time_elapsed.dart';
buildRefundAlert(
- {BuildContext context, DateTime timestamp, Icon icons, String message}) {
+ {required BuildContext context, required DateTime timestamp, Icon? icons, required String message}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0),
child: Material(
diff --git a/lib/Pages/PageWidgets/Alerts/header.dart b/lib/Pages/PageWidgets/Alerts/header.dart
index a3dd9b4..65b5103 100644
--- a/lib/Pages/PageWidgets/Alerts/header.dart
+++ b/lib/Pages/PageWidgets/Alerts/header.dart
@@ -7,10 +7,10 @@ import 'package:flutter/material.dart';
buildNotficationHeader(
BuildContext context,
- Color fcurrentColor,
- Color fcurrentColor1,
+ Color? fcurrentColor,
+ Color? fcurrentColor1,
Color fTextColor1,
- Color fTextColor2,
+ Color? fTextColor2,
Function navigationTapped,
bool status,
TesoUser user) {
@@ -40,14 +40,14 @@ buildNotficationHeader(
child: user.thumbnail_dp == null
? Center(
child: Text(
- user.username.characters
+ user.username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
),
)
: CachedNetworkImage(
- imageUrl: userdpURL + user.thumbnail_dp,
+ imageUrl: userdpURL + user.thumbnail_dp!,
imageBuilder: (context, imageProvider) => FadeInImage(
height: 90,
width: 90,
diff --git a/lib/Pages/PageWidgets/Alerts/personalizedCoupon.dart b/lib/Pages/PageWidgets/Alerts/personalizedCoupon.dart
index fa31241..948d64a 100644
--- a/lib/Pages/PageWidgets/Alerts/personalizedCoupon.dart
+++ b/lib/Pages/PageWidgets/Alerts/personalizedCoupon.dart
@@ -6,13 +6,13 @@ import 'package:teso/util/consts.dart';
import 'package:time_elapsed/time_elapsed.dart';
buildPersonalizedAlert(
- {BuildContext context,
- DateTime timestamp,
- Icon icons,
- String thumbnail,
- String message,
- Function accept,
- Function decline}) {
+ {required BuildContext context,
+ required DateTime timestamp,
+ Icon? icons,
+ required String thumbnail,
+ required String message,
+ Function? accept,
+ Function? decline}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0),
child: Material(
diff --git a/lib/Pages/PageWidgets/Alerts/post.dart b/lib/Pages/PageWidgets/Alerts/post.dart
index 32c65a9..f796454 100644
--- a/lib/Pages/PageWidgets/Alerts/post.dart
+++ b/lib/Pages/PageWidgets/Alerts/post.dart
@@ -4,11 +4,11 @@ import 'package:teso/util/consts.dart';
import 'package:time_elapsed/time_elapsed.dart';
buildPostAlert(
- {BuildContext context,
- DateTime timestamp,
- Icon icons,
- String thumbnail,
- String message}) {
+ {required BuildContext context,
+ required DateTime timestamp,
+ Icon? icons,
+ String? thumbnail,
+ required String message}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0),
child: Material(
diff --git a/lib/Pages/PageWidgets/Alerts/requestTile.dart b/lib/Pages/PageWidgets/Alerts/requestTile.dart
index e94ba22..844391b 100644
--- a/lib/Pages/PageWidgets/Alerts/requestTile.dart
+++ b/lib/Pages/PageWidgets/Alerts/requestTile.dart
@@ -5,14 +5,14 @@ import 'package:teso/util/consts.dart';
import 'package:teso/Classes/customTesoButton.dart';
buildRequest(
- {BuildContext context,
- DateTime timestamp,
- String description,
- Icon icons,
- String thumbnail,
- String username,
- Function approve,
- Function decline}) {
+ {required BuildContext context,
+ required DateTime timestamp,
+ required String description,
+ Icon? icons,
+ String? thumbnail,
+ String? username,
+ Function? approve,
+ Function? decline}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 8.0),
child: Material(
@@ -159,7 +159,7 @@ buildRequest(
color: Color.fromRGBO(0, 0, 0, 0.4),
child: Center(
child: Text(
- username.characters
+ username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
diff --git a/lib/Pages/PageWidgets/BusinessProfile/BusinessHead.dart b/lib/Pages/PageWidgets/BusinessProfile/BusinessHead.dart
index 2b9ab89..39f2a76 100644
--- a/lib/Pages/PageWidgets/BusinessProfile/BusinessHead.dart
+++ b/lib/Pages/PageWidgets/BusinessProfile/BusinessHead.dart
@@ -5,11 +5,11 @@ import 'package:flutter/material.dart';
import 'package:teso/Classes/TesoShop.dart';
buildHead(
- {BuildContext context,
- TesoShop shopSelected,
- int products,
- int subscribers,
- int coupons}) {
+ {required BuildContext context,
+ required TesoShop shopSelected,
+ required int products,
+ required int subscribers,
+ required int coupons}) {
return Container(
// height: MediaQuery.of(context).size.width -
// (MediaQuery.of(context).size.width * 0.40),
@@ -46,7 +46,7 @@ buildHead(
),
child: shopSelected.logo != "null"
? CachedNetworkImage(
- imageUrl: businessLogoURL + shopSelected.logo,
+ imageUrl: businessLogoURL + shopSelected.logo!,
imageBuilder: (context, imageProvider) =>
FadeInImage(
height: 90,
@@ -133,7 +133,7 @@ buildHead(
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
- shopSelected.shopAddress,
+ shopSelected.shopAddress!,
style: TextStyle(
fontWeight: FontWeight.w400,
//color: Colors.grey,
@@ -147,7 +147,7 @@ buildHead(
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
- shopSelected.categoryShop,
+ shopSelected.categoryShop!,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12,
@@ -163,8 +163,8 @@ buildHead(
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
- shopSelected.shopDescription.toLowerCase() != "null"
- ? shopSelected.shopDescription
+ shopSelected.shopDescription!.toLowerCase() != "null"
+ ? shopSelected.shopDescription!
: "",
style: TextStyle(
fontSize: 13,
diff --git a/lib/Pages/PageWidgets/BusinessProfile/BusinessItems.dart b/lib/Pages/PageWidgets/BusinessProfile/BusinessItems.dart
index 5372b7a..c87724d 100644
--- a/lib/Pages/PageWidgets/BusinessProfile/BusinessItems.dart
+++ b/lib/Pages/PageWidgets/BusinessProfile/BusinessItems.dart
@@ -14,7 +14,7 @@ buildItems(BuildContext context, Product product, double height) {
// borderRadius: BorderRadius.circular(30.0),
// ),
child: Hero(
- tag: product.productID,
+ tag: product.productID!,
child: GestureDetector(
onTap: () => Navigator.push(
context,
@@ -34,7 +34,7 @@ buildItems(BuildContext context, Product product, double height) {
width: double.infinity,
height: double.infinity,
fit: BoxFit.fill,
- image: NetworkImage(productURL + product.productImage),
+ image: NetworkImage(productURL + product.productImage!),
placeholder: AssetImage("assets/images/loading.png"),
),
Container(
@@ -49,7 +49,7 @@ buildItems(BuildContext context, Product product, double height) {
width: double.infinity,
margin: EdgeInsets.only(bottom: 40),
child: Text(
- product.productName.toUpperCase(),
+ product.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
diff --git a/lib/Pages/PageWidgets/ChatScreen/header.dart b/lib/Pages/PageWidgets/ChatScreen/header.dart
index 903e6bc..efb7f87 100644
--- a/lib/Pages/PageWidgets/ChatScreen/header.dart
+++ b/lib/Pages/PageWidgets/ChatScreen/header.dart
@@ -53,14 +53,14 @@ buildChatHead(BuildContext context, TesoUser user) {
child: user.thumbnail_dp == null
? Center(
child: Text(
- user.firstname.characters
+ user.firstname!.characters
.characterAt(0)
.toString()
.toUpperCase(),
),
)
: CachedNetworkImage(
- imageUrl: userdpURL + user.thumbnail_dp,
+ imageUrl: userdpURL + user.thumbnail_dp!,
imageBuilder: (context, imageProvider) => FadeInImage(
height: 90,
width: 90,
@@ -86,7 +86,7 @@ buildChatHead(BuildContext context, TesoUser user) {
direction: Axis.vertical,
children: [
Text(
- user.firstname + " " + user.lastname,
+ user.firstname! + " " + user.lastname!,
style: TextStyle(fontSize: 15),
textAlign: TextAlign.left,
),
diff --git a/lib/Pages/PageWidgets/ChatScreen/recipient.dart b/lib/Pages/PageWidgets/ChatScreen/recipient.dart
index b14315b..d8d919e 100644
--- a/lib/Pages/PageWidgets/ChatScreen/recipient.dart
+++ b/lib/Pages/PageWidgets/ChatScreen/recipient.dart
@@ -25,12 +25,12 @@ buildRecipient(BuildContext context, ChatMessage message) {
spacing: 10.0,
direction: Axis.horizontal,
children: [
- Text(message.content),
+ Text(message.content!),
Container(
child: Align(
alignment: Alignment.bottomRight,
child: Text(
- TimeElapsed.fromDateTime(message.timestamp),
+ TimeElapsed.fromDateTime(message.timestamp!),
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 10,
diff --git a/lib/Pages/PageWidgets/ChatScreen/sender.dart b/lib/Pages/PageWidgets/ChatScreen/sender.dart
index f46a26d..6fc78e9 100644
--- a/lib/Pages/PageWidgets/ChatScreen/sender.dart
+++ b/lib/Pages/PageWidgets/ChatScreen/sender.dart
@@ -25,12 +25,12 @@ buildSender(BuildContext context, ChatMessage document) {
spacing: 10.0,
direction: Axis.horizontal,
children: [
- Text(document.content),
+ Text(document.content!),
Container(
child: Align(
alignment: Alignment.bottomRight,
child: Text(
- TimeElapsed.fromDateTime(document.timestamp),
+ TimeElapsed.fromDateTime(document.timestamp!),
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 10,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/AmountInput.dart b/lib/Pages/PageWidgets/CoinPurchase/AmountInput.dart
index c623b15..afacf9b 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/AmountInput.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/AmountInput.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:teso/util/consts.dart';
-buildAmount(BuildContext context, TextEditingController user) {
+buildAmount(BuildContext context, TextEditingController? user) {
return Container(
width: double.infinity,
height: 45,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/MomoType.dart b/lib/Pages/PageWidgets/CoinPurchase/MomoType.dart
index fe26dcd..7525eb4 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/MomoType.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/MomoType.dart
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:teso/util/consts.dart';
-buildType(BuildContext context, String image, String type, Function selected,
- String tapped) {
+buildType(BuildContext context, String image, String? type, Function selected,
+ String? tapped) {
return Container(
margin: EdgeInsets.all(5),
width: 100,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/PayGold.dart b/lib/Pages/PageWidgets/CoinPurchase/PayGold.dart
index 0baf728..b8239c8 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/PayGold.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/PayGold.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
payWithGold(
- BuildContext context, String type, Function selected, String tapped) {
+ BuildContext context, String type, Function selected, String? tapped) {
return Container(
margin: EdgeInsets.all(5),
width: 90,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/SilverAmountInput.dart b/lib/Pages/PageWidgets/CoinPurchase/SilverAmountInput.dart
index 68731a4..9c84ad7 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/SilverAmountInput.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/SilverAmountInput.dart
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:teso/util/consts.dart';
-buildAmount(BuildContext context, TextEditingController user) {
+buildAmount(BuildContext context, TextEditingController? user) {
return Container(
width: 100,
height: 65,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/SilverPurchase.dart b/lib/Pages/PageWidgets/CoinPurchase/SilverPurchase.dart
index 1afcb45..3f0d395 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/SilverPurchase.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/SilverPurchase.dart
@@ -4,11 +4,11 @@ import 'package:flutter/material.dart';
import 'package:teso/Pages/Sub_Pages/CoinsPurchase/SilverPurchaseFixed.dart';
buildSilverCard({
- BuildContext context,
- String goldEquivalent,
- String cashEquivalent,
- String funds,
- TesoUser user,
+ required BuildContext context,
+ required String goldEquivalent,
+ required String cashEquivalent,
+ required String funds,
+ TesoUser? user,
}) {
return Container(
margin: EdgeInsets.all(10),
diff --git a/lib/Pages/PageWidgets/CoinPurchase/phonenumber.dart b/lib/Pages/PageWidgets/CoinPurchase/phonenumber.dart
index 3548def..247e6df 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/phonenumber.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/phonenumber.dart
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:teso/util/consts.dart';
-inputTelNumber(BuildContext context, TextEditingController user) {
+inputTelNumber(BuildContext context, TextEditingController? user) {
return Container(
width: double.infinity,
height: 45,
diff --git a/lib/Pages/PageWidgets/CoinPurchase/selector.dart b/lib/Pages/PageWidgets/CoinPurchase/selector.dart
index cfbe216..6a28d32 100644
--- a/lib/Pages/PageWidgets/CoinPurchase/selector.dart
+++ b/lib/Pages/PageWidgets/CoinPurchase/selector.dart
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
buildSelector(BuildContext context, String title, double size,
List color, Function tapped, Color textColor) {
return InkWell(
- onTap: tapped,
+ onTap: tapped as void Function()?,
child: Container(
width: size - size * 0.55,
height: 42.5,
diff --git a/lib/Pages/PageWidgets/Coupons/GiftFriend.dart b/lib/Pages/PageWidgets/Coupons/GiftFriend.dart
index 01da598..9791c42 100644
--- a/lib/Pages/PageWidgets/Coupons/GiftFriend.dart
+++ b/lib/Pages/PageWidgets/Coupons/GiftFriend.dart
@@ -3,10 +3,10 @@ import 'package:teso/util/consts.dart';
import 'package:teso/Classes/TesoUser.dart';
buildGiftRecipient(
- {BuildContext context,
- TextEditingController searchkey,
- TesoUser friend,
- Function loadFriend}) {
+ {required BuildContext context,
+ TextEditingController? searchkey,
+ TesoUser? friend,
+ Function? loadFriend}) {
return Container(
height: 60.0,
padding: EdgeInsets.all(10.0),
@@ -35,7 +35,7 @@ buildGiftRecipient(
: friend.thumbnail_dp == null
? Center(
child: Text(
- friend.username.characters
+ friend.username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
@@ -45,7 +45,7 @@ buildGiftRecipient(
height: 45,
width: 45,
fit: BoxFit.fill,
- image: NetworkImage(userdpURL + friend.thumbnail_dp),
+ image: NetworkImage(userdpURL + friend.thumbnail_dp!),
placeholder:
AssetImage("assets/images/tesoDP/dp1.png"),
),
@@ -53,7 +53,7 @@ buildGiftRecipient(
),
new Expanded(
child: InkWell(
- onTap: loadFriend,
+ onTap: loadFriend as void Function()?,
child: TextField(
autofocus: false,
enabled: false,
diff --git a/lib/Pages/PageWidgets/Coupons/mycoupons.dart b/lib/Pages/PageWidgets/Coupons/mycoupons.dart
index f448adb..2701325 100644
--- a/lib/Pages/PageWidgets/Coupons/mycoupons.dart
+++ b/lib/Pages/PageWidgets/Coupons/mycoupons.dart
@@ -1,3 +1,7 @@
+// ignore_for_file: unnecessary_null_comparison
+
+import 'dart:async';
+
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:location/location.dart';
@@ -44,7 +48,7 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
bottomRight: Radius.circular(30),
),
child: CachedNetworkImage(
- imageUrl: productURL + coupon.targetProduct.productImage,
+ imageUrl: productURL + coupon.targetProduct!.productImage!,
imageBuilder: (context, imageProvider) => Image(
width: MediaQuery.of(context).size.width * 0.28,
height: 110,
@@ -64,7 +68,7 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
Container(
width: double.infinity,
child: Text(
- "Item Name : " + coupon.targetProduct.productName,
+ "Item Name : " + coupon.targetProduct!.productName!,
style: TextStyle(
fontSize: SizeConfig.safeBlockHorizontal * 2.8,
),
@@ -73,7 +77,7 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
Container(
width: double.infinity,
child: Text(
- "Shop Name : " + coupon.issuer.businessName,
+ "Shop Name : " + coupon.issuer!.businessName!,
style: TextStyle(
fontSize: SizeConfig.safeBlockHorizontal * 2.8,
),
@@ -82,19 +86,19 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
Container(
width: double.infinity,
child: CountdownTimer(
- endTime: coupon.expiration.millisecondsSinceEpoch,
+ endTime: coupon.expiration!.millisecondsSinceEpoch,
widgetBuilder: (context, time) {
- int day = time.days;
- int hours = time.hours;
- int min = time.min;
- int sec = time.sec;
+ int? day = time!.days;
+ int? hours = time.hours;
+ int? min = time.min;
+ int? sec = time.sec;
if (time.min == null) min = 0;
if (time.days == null) day = 0;
if (time.hours == null) hours = 0;
if (time.sec == null) sec = 0;
if (time == null) {
return Text('Calculating..');
- } else if (time.days == null || time.days < 1) {
+ } else if (time.days == null || time.days! < 1) {
return Text(
"Expires in : ${hours}h : ${min}m : ${sec}s",
style: TextStyle(
@@ -130,9 +134,9 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
width: double.infinity,
child: Text(
"Pay only : GH¢ " +
- (coupon.targetProduct.unitPrice -
- (coupon.targetProduct.unitPrice *
- (coupon.lowerLimit / 100)))
+ (coupon.targetProduct!.unitPrice! -
+ (coupon.targetProduct!.unitPrice! *
+ (coupon.lowerLimit! / 100)))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.red,
@@ -162,11 +166,11 @@ buildMyCoupons(BuildContext context, CouponDetails coupon, Function dialog,
PermissionStatus alreadyConsent =
await Location.instance.hasPermission();
if (alreadyConsent != PermissionStatus.granted) {
- bool results = await Navigator.push(
+ bool results = await (Navigator.push(
context,
PageTransition(
child: ProminentDisclosure(),
- type: PageTransitionType.leftToRight));
+ type: PageTransitionType.leftToRight)) as FutureOr);
if (results) {
await Location.instance.requestPermission();
Navigator.push(
diff --git a/lib/Pages/PageWidgets/Coupons/personalizedDiscount.dart b/lib/Pages/PageWidgets/Coupons/personalizedDiscount.dart
index d46285a..d5d0f2a 100644
--- a/lib/Pages/PageWidgets/Coupons/personalizedDiscount.dart
+++ b/lib/Pages/PageWidgets/Coupons/personalizedDiscount.dart
@@ -39,7 +39,7 @@ buildPersonalizedDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: coupon.upperLimit < 50.1
+ image: coupon.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -89,7 +89,7 @@ buildPersonalizedDiscountCoupon(
child: Column(
children: [
Text(
- coupon.issuer.businessName.toUpperCase(),
+ coupon.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -128,7 +128,7 @@ buildPersonalizedDiscountCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- coupon.targetProduct.unitPrice.toString(),
+ coupon.targetProduct!.unitPrice.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@@ -136,8 +136,8 @@ buildPersonalizedDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (coupon.targetProduct.unitPrice- (coupon.targetProduct.unitPrice *
- (coupon.lowerLimit / 100)))
+ (coupon.targetProduct!.unitPrice!- (coupon.targetProduct!.unitPrice! *
+ (coupon.lowerLimit! / 100)))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -155,7 +155,7 @@ buildPersonalizedDiscountCoupon(
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- coupon.targetProduct.productName.toUpperCase(),
+ coupon.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -188,8 +188,8 @@ buildPersonalizedDiscountCoupon(
Container(
child: Text(
"Pay : GH¢ " +
- (coupon.targetProduct.unitPrice- (coupon.targetProduct.unitPrice *
- (coupon.lowerLimit / 100)))
+ (coupon.targetProduct!.unitPrice!- (coupon.targetProduct!.unitPrice! *
+ (coupon.lowerLimit! / 100)))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -202,7 +202,7 @@ buildPersonalizedDiscountCoupon(
? Container()
: Container(
child: Text(
- "Condition : " + coupon.condition,
+ "Condition : " + coupon.condition!,
),
),
],
@@ -281,9 +281,9 @@ buildPersonalizedDiscountCoupon(
),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
- primary: coupon.upperLimit < 50.1 ? tesoBlue : Colors.red,
+ primary: coupon.upperLimit! < 50.1 ? tesoBlue : Colors.red,
),
- onPressed: acquiring,
+ onPressed: acquiring as void Function()?,
child: Text(
"Accept Coupon",
style: TextStyle(color: Colors.white),
diff --git a/lib/Pages/PageWidgets/Coupons/personalizedFreebie.dart b/lib/Pages/PageWidgets/Coupons/personalizedFreebie.dart
index 5589788..f5d9798 100644
--- a/lib/Pages/PageWidgets/Coupons/personalizedFreebie.dart
+++ b/lib/Pages/PageWidgets/Coupons/personalizedFreebie.dart
@@ -83,7 +83,7 @@ buildPersonalizedFreebieCoupon(
child: Column(
children: [
Text(
- coupon.issuer.businessName.toUpperCase(),
+ coupon.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -123,7 +123,7 @@ buildPersonalizedFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- coupon.targetProduct.unitPrice
+ coupon.targetProduct!.unitPrice!
.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
@@ -148,7 +148,7 @@ buildPersonalizedFreebieCoupon(
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- coupon.targetProduct.productName.toUpperCase(),
+ coupon.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -192,7 +192,7 @@ buildPersonalizedFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- coupon.condition
+ coupon.condition!
.replaceAll('"', ""),
style: TextStyle(
color: Colors.black,
@@ -267,7 +267,7 @@ buildPersonalizedFreebieCoupon(
style: ElevatedButton.styleFrom(
primary: accentMain,
),
- onPressed: acquiring,
+ onPressed: acquiring as void Function()?,
child: Text(
"Accept Coupon",
style: TextStyle(color: Colors.white),
diff --git a/lib/Pages/PageWidgets/CouponsList/activeCoupon.dart b/lib/Pages/PageWidgets/CouponsList/activeCoupon.dart
index 1bda217..ebca9ac 100644
--- a/lib/Pages/PageWidgets/CouponsList/activeCoupon.dart
+++ b/lib/Pages/PageWidgets/CouponsList/activeCoupon.dart
@@ -46,7 +46,7 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: coupon.upperLimit < 50.1
+ image: coupon.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -96,7 +96,7 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
child: Column(
children: [
Text(
- coupon.issuer.businessName.toUpperCase(),
+ coupon.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -135,7 +135,7 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- coupon.targetProduct.unitPrice
+ coupon.targetProduct!.unitPrice
.toString(),
style: TextStyle(
color: Colors.white,
@@ -146,10 +146,10 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (coupon.targetProduct.unitPrice -
- (coupon.targetProduct
- .unitPrice *
- (coupon.worth / 100)))
+ (coupon.targetProduct!.unitPrice! -
+ (coupon.targetProduct!
+ .unitPrice! *
+ (coupon.worth! / 100)))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -187,8 +187,8 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
),
child: Text(
CouponRateCalculator.getRate(coupon
- .targetProduct.unitPrice *
- (coupon.worth / 100))
+ .targetProduct!.unitPrice! *
+ (coupon.worth! / 100))
.toString(),
style: TextStyle(
color: Colors.white,
@@ -212,7 +212,7 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- coupon.targetProduct.productName.toUpperCase(),
+ coupon.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -245,10 +245,10 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
Container(
child: Text(
"Pay : GH¢ " +
- (coupon.targetProduct.unitPrice -
- (coupon.targetProduct
- .unitPrice *
- (coupon.worth / 100)))
+ (coupon.targetProduct!.unitPrice! -
+ (coupon.targetProduct!
+ .unitPrice! *
+ (coupon.worth! / 100)))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -262,7 +262,7 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
: Container(
child: Text(
"Condition : " +
- coupon.condition
+ coupon.condition!
.replaceAll('"', ""),
),
),
@@ -309,11 +309,11 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
mainAxisSize: MainAxisSize.min,
children: [
Text(
- coupon.worth.toStringAsFixed(1) + "%",
+ coupon.worth!.toStringAsFixed(1) + "%",
style: TextStyle(
color: Colors.white,
fontSize:
- SizeConfig.safeBlockHorizontal * 6,
+ SizeConfig.safeBlockHorizontal * 4,
fontWeight: FontWeight.w900,
),
),
@@ -349,20 +349,20 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
- primary: coupon.upperLimit < 50.1 ? tesoBlue : Colors.red,
+ primary: coupon.upperLimit! < 50.1 ? tesoBlue : Colors.red,
),
onPressed: () async {
CouponsHead couponsHead = new CouponsHead();
- couponsHead.businessId = coupon.issuer.businessId;
+ couponsHead.businessId = coupon.issuer!.businessId;
couponsHead.expiration = coupon.expiration;
couponsHead.couponId = coupon.couponId;
couponsHead.quantity = 1;
couponsHead.state = "active";
couponsHead.lower = coupon.worth;
couponsHead.upper = coupon.upperLimit;
- couponsHead.targetProduct = coupon.targetProduct.productID;
+ couponsHead.targetProduct = coupon.targetProduct!.productID;
double price =
- coupon.targetProduct.unitPrice * (coupon.worth / 100);
+ coupon.targetProduct!.unitPrice! * (coupon.worth! / 100);
int cost = CouponRateCalculator.getRate(price);
acquiring(couponsHead, cost);
@@ -401,9 +401,9 @@ buildActiveDiscountCoupon(BuildContext context, CouponDetails coupon,
child: new RotatedBox(
quarterTurns: 3,
child: Slider(
- value: coupon.worth,
- min: coupon.lowerLimit,
- max: coupon.upperLimit,
+ value: coupon.worth!,
+ min: coupon.lowerLimit!,
+ max: coupon.upperLimit!,
divisions: 20,
activeColor: accentMain,
inactiveColor: darkAccent,
diff --git a/lib/Pages/PageWidgets/CouponsList/activeFreebieCoupon.dart b/lib/Pages/PageWidgets/CouponsList/activeFreebieCoupon.dart
index 185f7da..ba50c39 100644
--- a/lib/Pages/PageWidgets/CouponsList/activeFreebieCoupon.dart
+++ b/lib/Pages/PageWidgets/CouponsList/activeFreebieCoupon.dart
@@ -87,7 +87,7 @@ buildFreebieCoupon(
child: Column(
children: [
Text(
- coupon.issuer.businessName.toUpperCase(),
+ coupon.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -128,7 +128,7 @@ buildFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- coupon.targetProduct.unitPrice
+ coupon.targetProduct!.unitPrice!
.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
@@ -175,8 +175,8 @@ buildFreebieCoupon(
),
child: Text(
CouponRateCalculator.getRate(
- coupon.targetProduct.unitPrice *
- (coupon.worth / 100))
+ coupon.targetProduct!.unitPrice! *
+ (coupon.worth! / 100))
.toString(),
style: TextStyle(
color: Colors.black,
@@ -201,7 +201,7 @@ buildFreebieCoupon(
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- coupon.targetProduct.productName.toUpperCase(),
+ coupon.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -245,7 +245,7 @@ buildFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- coupon.condition
+ coupon.condition!
.replaceAll('"', ""),
style: TextStyle(
color: Colors.black,
@@ -322,16 +322,16 @@ buildFreebieCoupon(
),
onPressed: () async {
CouponsHead couponsHead = new CouponsHead();
- couponsHead.businessId = coupon.issuer.businessId;
+ couponsHead.businessId = coupon.issuer!.businessId;
couponsHead.expiration = coupon.expiration;
couponsHead.couponId = coupon.couponId;
couponsHead.quantity = 1;
couponsHead.state = "active";
couponsHead.lower = 100;
couponsHead.upper = 100;
- couponsHead.targetProduct = coupon.targetProduct.productID;
+ couponsHead.targetProduct = coupon.targetProduct!.productID;
double price =
- coupon.targetProduct.unitPrice * (couponsHead.lower / 100);
+ coupon.targetProduct!.unitPrice! * (couponsHead.lower! / 100);
int cost = CouponRateCalculator.getRate(price);
acquiring(couponsHead, cost);
},
diff --git a/lib/Pages/PageWidgets/DesireComeTrue/DesireTile.dart b/lib/Pages/PageWidgets/DesireComeTrue/DesireTile.dart
index 5f88400..6726859 100644
--- a/lib/Pages/PageWidgets/DesireComeTrue/DesireTile.dart
+++ b/lib/Pages/PageWidgets/DesireComeTrue/DesireTile.dart
@@ -37,7 +37,7 @@ buildProductDesire(BuildContext context, Desire item, Function addItem) {
width: MediaQuery.of(context).size.width * 0.28,
fit: BoxFit.fill,
//controller: controller,
- image: NetworkImage(productURL + item.productImage),
+ image: NetworkImage(productURL + item.productImage!),
),
),
),
@@ -48,7 +48,7 @@ buildProductDesire(BuildContext context, Desire item, Function addItem) {
children: [
Container(
width: double.infinity,
- child: Text("Item Name : " + item.productName),
+ child: Text("Item Name : " + item.productName!),
),
Container(
width: double.infinity,
diff --git a/lib/Pages/PageWidgets/DesireComeTrue/DesiredItem.dart b/lib/Pages/PageWidgets/DesireComeTrue/DesiredItem.dart
index 79a906b..1853de2 100644
--- a/lib/Pages/PageWidgets/DesireComeTrue/DesiredItem.dart
+++ b/lib/Pages/PageWidgets/DesireComeTrue/DesiredItem.dart
@@ -4,10 +4,10 @@ import 'package:jiffy/jiffy.dart';
import 'package:shared_preferences/shared_preferences.dart';
class DesiredItem extends StatefulWidget {
- final Desire item;
- final int number;
- final List selected;
- const DesiredItem({Key key, this.item, this.number, this.selected})
+ final Desire? item;
+ final int? number;
+ final List? selected;
+ const DesiredItem({Key? key, this.item, this.number, this.selected})
: super(key: key);
@override
_DesiredItemState createState() => _DesiredItemState();
@@ -15,10 +15,10 @@ class DesiredItem extends StatefulWidget {
class _DesiredItemState extends State
with TickerProviderStateMixin {
- Animation _spaceWidth;
- AnimationController _controller;
- AnimationController _strikeController;
- Animation _strikePercent;
+ late Animation _spaceWidth;
+ late AnimationController _controller;
+ late AnimationController _strikeController;
+ late Animation _strikePercent;
bool cancelled = false;
@@ -77,14 +77,14 @@ class _DesiredItemState extends State
removeElement(item) {
cancel();
if (cancelled) {
- widget.selected.remove(item);
+ widget.selected!.remove(item);
SharedPreferences.getInstance().then((value) {
var jiffy = Jiffy()..add(months: 1);
value.setString(
"desire" + jiffy.format("MMMM, yyyy"), widget.selected.toString());
});
} else {
- widget.selected.insert(widget.number - 1, item);
+ widget.selected!.insert(widget.number! - 1, item);
SharedPreferences.getInstance().then((value) {
var jiffy = Jiffy()..add(months: 1);
value.setString(
@@ -122,10 +122,10 @@ class _DesiredItemState extends State
foregroundPainter:
StrikeThroughPainter(_strikePercent.value),
child: Text(
- widget.item.productName.length > 20
- ? widget.item.productName.substring(0, 16) +
+ widget.item!.productName!.length > 20
+ ? widget.item!.productName!.substring(0, 16) +
"......"
- : widget.item.productName,
+ : widget.item!.productName!,
style: _getValidateStyle(true)),
),
),
diff --git a/lib/Pages/PageWidgets/Editors/SampleThumbnail.dart b/lib/Pages/PageWidgets/Editors/SampleThumbnail.dart
index 0cb800c..9a5ff7e 100644
--- a/lib/Pages/PageWidgets/Editors/SampleThumbnail.dart
+++ b/lib/Pages/PageWidgets/Editors/SampleThumbnail.dart
@@ -19,7 +19,7 @@ buildFilterThumb(BuildContext context, ColorFilter color, Uint8List thumb) {
width: SizeConfig.safeBlockHorizontal * 25,
color: Color.fromRGBO(0, 0, 0, 0.8),
child: Text(
- color.name,
+ color.name!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
@@ -39,9 +39,9 @@ buildFilterThumb(BuildContext context, ColorFilter color, Uint8List thumb) {
Container(
width: SizeConfig.safeBlockHorizontal * 25,
height: 93,
- color: color.name.toLowerCase() == "original"
- ? color.code.withOpacity(0)
- : color.code.withOpacity(0.5),
+ color: color.name!.toLowerCase() == "original"
+ ? color.code!.withOpacity(0)
+ : color.code!.withOpacity(0.5),
),
],
),
diff --git a/lib/Pages/PageWidgets/Explore/business.dart b/lib/Pages/PageWidgets/Explore/business.dart
index 18457eb..bd58b8d 100644
--- a/lib/Pages/PageWidgets/Explore/business.dart
+++ b/lib/Pages/PageWidgets/Explore/business.dart
@@ -27,7 +27,7 @@ buildBusiness(BuildContext context, TesoShop shop) {
height: MediaQuery.of(context).size.width * 0.60,
child: Wrap(
children: [
- shop.logo.toLowerCase() == "null" || shop.logo == null
+ shop.logo!.toLowerCase() == "null" || shop.logo == null
? Image(
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.45,
@@ -35,7 +35,7 @@ buildBusiness(BuildContext context, TesoShop shop) {
image: AssetImage("assets/images/store.png"),
)
: CachedNetworkImage(
- imageUrl: businessLogoURL + shop.logo,
+ imageUrl: businessLogoURL + shop.logo!,
imageBuilder: (context, imageProvider) => FadeInImage(
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.45,
@@ -50,7 +50,7 @@ buildBusiness(BuildContext context, TesoShop shop) {
color: Colors.white10,
),
child: Text(
- shop.shopName.toUpperCase(),
+ shop.shopName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
// color: Colors.black45,
@@ -63,7 +63,7 @@ buildBusiness(BuildContext context, TesoShop shop) {
width: MediaQuery.of(context).size.width,
color: Colors.white10,
child: Text(
- shop.categoryShop,
+ shop.categoryShop!,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
@@ -74,7 +74,7 @@ buildBusiness(BuildContext context, TesoShop shop) {
width: MediaQuery.of(context).size.width,
color: Colors.white10,
child: Text(
- shop.shopAddress,
+ shop.shopAddress!,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
diff --git a/lib/Pages/PageWidgets/Explore/categoriesTile.dart b/lib/Pages/PageWidgets/Explore/categoriesTile.dart
index 1fbaf6f..fadf86c 100644
--- a/lib/Pages/PageWidgets/Explore/categoriesTile.dart
+++ b/lib/Pages/PageWidgets/Explore/categoriesTile.dart
@@ -28,7 +28,7 @@ buildCategory(BuildContext context, Category category) {
Container(
margin: EdgeInsets.all(4.5),
child: Image(
- image: AssetImage(category.image),
+ image: AssetImage(category.image!),
width: 24,
height: 24,
),
@@ -38,7 +38,7 @@ buildCategory(BuildContext context, Category category) {
),
Container(
margin: EdgeInsets.all(4.5),
- child: Text(category.name),
+ child: Text(category.name!),
),
],
),
diff --git a/lib/Pages/PageWidgets/Explore/popular.dart b/lib/Pages/PageWidgets/Explore/popular.dart
index 6321fb0..806af53 100644
--- a/lib/Pages/PageWidgets/Explore/popular.dart
+++ b/lib/Pages/PageWidgets/Explore/popular.dart
@@ -58,7 +58,7 @@ buildPopularItem(BuildContext context, Product product) {
),
Center(
child: Text(
- product.productName.toUpperCase(),
+ product.productName!.toUpperCase(),
style: TextStyle(
fontSize: SizeConfig.blockSizeHorizontal * 3.5,
color: Colors.white,
diff --git a/lib/Pages/PageWidgets/Explore/products.dart b/lib/Pages/PageWidgets/Explore/products.dart
index aa1c9bc..19b48ce 100644
--- a/lib/Pages/PageWidgets/Explore/products.dart
+++ b/lib/Pages/PageWidgets/Explore/products.dart
@@ -46,7 +46,7 @@ buildProducts(BuildContext context, Product product) {
),
child: Center(
child: Text(
- product.productName.toUpperCase(),
+ product.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
diff --git a/lib/Pages/PageWidgets/Explore/trending.dart b/lib/Pages/PageWidgets/Explore/trending.dart
index b9202b0..69fd189 100644
--- a/lib/Pages/PageWidgets/Explore/trending.dart
+++ b/lib/Pages/PageWidgets/Explore/trending.dart
@@ -44,7 +44,7 @@ buildTrend(BuildContext context, Product product) {
width: double.infinity,
margin: EdgeInsets.only(bottom: 40),
child: Text(
- product.productName.toUpperCase(),
+ product.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
diff --git a/lib/Pages/PageWidgets/Friends/friendTile.dart b/lib/Pages/PageWidgets/Friends/friendTile.dart
index 324e35d..677f193 100644
--- a/lib/Pages/PageWidgets/Friends/friendTile.dart
+++ b/lib/Pages/PageWidgets/Friends/friendTile.dart
@@ -22,14 +22,14 @@ buildFriend(BuildContext context, TesoUser friend) {
child: friend.thumbnail_dp == null
? Center(
child: Text(
- friend.username.characters
+ friend.username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
),
)
: CachedNetworkImage(
- imageUrl: userdpURL + friend.thumbnail_dp,
+ imageUrl: userdpURL + friend.thumbnail_dp!,
imageBuilder: (context, imageProvider) => Image(
height: 90,
width: 90,
@@ -54,7 +54,7 @@ buildFriend(BuildContext context, TesoUser friend) {
child: Align(
alignment: Alignment.centerLeft,
child: Text(
- friend.username,
+ friend.username!,
style: TextStyle(
fontSize: 12.5,
color: Colors.grey,
@@ -68,7 +68,7 @@ buildFriend(BuildContext context, TesoUser friend) {
width: MediaQuery.of(context).size.width -
(MediaQuery.of(context).size.width * 0.35),
child: Text(
- friend.firstname + " " + friend.lastname,
+ friend.firstname! + " " + friend.lastname!,
textAlign: TextAlign.left,
),
),
diff --git a/lib/Pages/PageWidgets/Friends/header.dart b/lib/Pages/PageWidgets/Friends/header.dart
index 12aa981..878a9e6 100644
--- a/lib/Pages/PageWidgets/Friends/header.dart
+++ b/lib/Pages/PageWidgets/Friends/header.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
buildFriendsHeader(
- BuildContext context, TextEditingController searchkey, Function filter) {
+ BuildContext context, TextEditingController? searchkey, Function filter) {
return Container(
height: 60.0,
//margin: EdgeInsets.all(10.0),
diff --git a/lib/Pages/PageWidgets/HomeProximity/ActiveDiscount.dart b/lib/Pages/PageWidgets/HomeProximity/ActiveDiscount.dart
index 30d1332..1a216dc 100644
--- a/lib/Pages/PageWidgets/HomeProximity/ActiveDiscount.dart
+++ b/lib/Pages/PageWidgets/HomeProximity/ActiveDiscount.dart
@@ -26,8 +26,8 @@ Positioned buildActiveDiscountCoupon(
double worth,
Function calWorth) {
SizeConfig().init(context);
- if (worth < img.lowerLimit) {
- worth = img.lowerLimit;
+ if (worth < img.lowerLimit!) {
+ worth = img.lowerLimit!;
}
return new Positioned(
bottom: bottom,
@@ -54,7 +54,7 @@ Positioned buildActiveDiscountCoupon(
InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.business.businessId;
+ head.businessId = img.business!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
@@ -65,7 +65,7 @@ Positioned buildActiveDiscountCoupon(
head.type = img.type;
CouponDetails details = new CouponDetails();
- details.businessId = img.business.businessId;
+ details.businessId = img.business!.businessId;
details.countID = "null";
details.couponId = img.couponId;
details.expiration = img.expiration;
@@ -76,11 +76,11 @@ Positioned buildActiveDiscountCoupon(
details.state = img.state;
details.type = img.type;
details.targetProduct = new Product();
- details.targetProduct.businessID = details.businessId;
- details.targetProduct.productImage = img.targetImage;
- details.targetProduct.productName = img.targetName;
- details.targetProduct.unitPrice = img.targetCost;
- details.targetProduct.productDesc = img.tagretDescription;
+ details.targetProduct!.businessID = details.businessId;
+ details.targetProduct!.productImage = img.targetImage;
+ details.targetProduct!.productName = img.targetName;
+ details.targetProduct!.unitPrice = img.targetCost;
+ details.targetProduct!.productDesc = img.tagretDescription;
Provider.of(context, listen: false)
.viewCoupon(head);
@@ -132,7 +132,7 @@ Positioned buildActiveDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage(
@@ -189,7 +189,7 @@ Positioned buildActiveDiscountCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -230,7 +230,7 @@ Positioned buildActiveDiscountCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost
+ img.targetCost!
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -242,8 +242,8 @@ Positioned buildActiveDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetCost -
- (img.targetCost *
+ (img.targetCost! -
+ (img.targetCost! *
(worth / 100)))
.toStringAsFixed(2),
style: TextStyle(
@@ -287,7 +287,7 @@ Positioned buildActiveDiscountCoupon(
child: Text(
CouponRateCalculator
.getRate(
- img.targetCost *
+ img.targetCost! *
(worth /
100))
.toString(),
@@ -316,7 +316,7 @@ Positioned buildActiveDiscountCoupon(
.width *
0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -352,8 +352,8 @@ Positioned buildActiveDiscountCoupon(
Container(
child: Text(
"Pay : GH¢ " +
- (img.targetCost -
- (img.targetCost *
+ (img.targetCost! -
+ (img.targetCost! *
(worth / 100)))
.toStringAsFixed(2) +
" only",
@@ -368,7 +368,7 @@ Positioned buildActiveDiscountCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition
+ img.condition!
.replaceAll(
'"', ""),
),
@@ -467,7 +467,7 @@ Positioned buildActiveDiscountCoupon(
children: [
Container(
child: Text(
- img.upperLimit.toStringAsFixed(1) + " %",
+ img.upperLimit!.toStringAsFixed(1) + " %",
textAlign: TextAlign.center,
style: TextStyle(
foreground: Paint()
@@ -483,8 +483,8 @@ Positioned buildActiveDiscountCoupon(
quarterTurns: 3,
child: Slider(
value: worth,
- min: img.lowerLimit,
- max: img.upperLimit,
+ min: img.lowerLimit!,
+ max: img.upperLimit!,
divisions: 20,
activeColor: accentMain,
inactiveColor: darkAccent,
diff --git a/lib/Pages/PageWidgets/HomeProximity/ActiveFreebie.dart b/lib/Pages/PageWidgets/HomeProximity/ActiveFreebie.dart
index 71fd715..7e7887c 100644
--- a/lib/Pages/PageWidgets/HomeProximity/ActiveFreebie.dart
+++ b/lib/Pages/PageWidgets/HomeProximity/ActiveFreebie.dart
@@ -64,7 +64,7 @@ Positioned buildActiveFreebieCoupon(
child: InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.business.businessId;
+ head.businessId = img.business!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
@@ -75,7 +75,7 @@ Positioned buildActiveFreebieCoupon(
head.type = img.type;
CouponDetails details = new CouponDetails();
- details.businessId = img.business.businessId;
+ details.businessId = img.business!.businessId;
details.countID = "null";
details.couponId = img.couponId;
details.expiration = img.expiration;
@@ -86,11 +86,11 @@ Positioned buildActiveFreebieCoupon(
details.state = img.state;
details.type = img.type;
details.targetProduct = new Product();
- details.targetProduct.businessID = details.businessId;
- details.targetProduct.productImage = img.targetImage;
- details.targetProduct.productName = img.targetName;
- details.targetProduct.unitPrice = img.targetCost;
- details.targetProduct.productDesc = img.tagretDescription;
+ details.targetProduct!.businessID = details.businessId;
+ details.targetProduct!.productImage = img.targetImage;
+ details.targetProduct!.productName = img.targetName;
+ details.targetProduct!.unitPrice = img.targetCost;
+ details.targetProduct!.productDesc = img.tagretDescription;
Provider.of(context, listen: false)
.viewCoupon(head);
@@ -163,7 +163,7 @@ Positioned buildActiveFreebieCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -204,7 +204,7 @@ Positioned buildActiveFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost.toStringAsFixed(2),
+ img.targetCost!.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -252,8 +252,8 @@ Positioned buildActiveFreebieCoupon(
),
child: Text(
CouponRateCalculator.getRate(
- img.targetCost *
- (img.lowerLimit / 100))
+ img.targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.black,
@@ -278,7 +278,7 @@ Positioned buildActiveFreebieCoupon(
MediaQuery.of(context).size.width *
0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -322,7 +322,7 @@ Positioned buildActiveFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition
+ img.condition!
.replaceAll('"', ""),
),
),
diff --git a/lib/Pages/PageWidgets/HomeProximity/DummyDiscount.dart b/lib/Pages/PageWidgets/HomeProximity/DummyDiscount.dart
index e8edf53..f919541 100644
--- a/lib/Pages/PageWidgets/HomeProximity/DummyDiscount.dart
+++ b/lib/Pages/PageWidgets/HomeProximity/DummyDiscount.dart
@@ -14,7 +14,7 @@ Positioned buildDummyDiscountCoupon(
double skew,
BuildContext context,
String discount,
- double selectedDiscount) {
+ double? selectedDiscount) {
return new Positioned(
bottom: 60 + bottom,
child: Container(
@@ -46,7 +46,7 @@ Positioned buildDummyDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -94,7 +94,7 @@ Positioned buildDummyDiscountCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -141,9 +141,9 @@ Positioned buildDummyDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetCost -
- (img.targetCost *
- (img.lowerLimit / 100)))
+ (img.targetCost! -
+ (img.targetCost! *
+ (img.lowerLimit! / 100)))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -166,8 +166,8 @@ Positioned buildDummyDiscountCoupon(
AssetImage("assets/images/silver1.png"),
),
Text(
- CouponRateCalculator.getRate(img.targetCost *
- (img.lowerLimit / 100))
+ CouponRateCalculator.getRate(img.targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.white,
@@ -186,7 +186,7 @@ Positioned buildDummyDiscountCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetName,
+ img.targetName!,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -219,7 +219,7 @@ Positioned buildDummyDiscountCoupon(
Container(
child: Text(
"Price : GH¢ " +
- (img.targetCost * (img.lowerLimit / 100))
+ (img.targetCost! * (img.lowerLimit! / 100))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -233,7 +233,7 @@ Positioned buildDummyDiscountCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition.replaceAll('"', ""),
+ img.condition!.replaceAll('"', ""),
),
),
],
@@ -276,7 +276,7 @@ Positioned buildDummyDiscountCoupon(
mainAxisSize: MainAxisSize.min,
children: [
Text(
- img.lowerLimit.toStringAsFixed(1) + "%",
+ img.lowerLimit!.toStringAsFixed(1) + "%",
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.safeBlockHorizontal * 6,
diff --git a/lib/Pages/PageWidgets/HomeProximity/DummyFreebie.dart b/lib/Pages/PageWidgets/HomeProximity/DummyFreebie.dart
index 43288fe..bbd1a38 100644
--- a/lib/Pages/PageWidgets/HomeProximity/DummyFreebie.dart
+++ b/lib/Pages/PageWidgets/HomeProximity/DummyFreebie.dart
@@ -15,7 +15,7 @@ Positioned buildDummyFreebieCoupon(
double skew,
BuildContext context,
String discount,
- double selectedDiscount) {
+ double? selectedDiscount) {
SizeConfig().init(context);
return new Positioned(
bottom: 60.0 + bottom,
@@ -89,7 +89,7 @@ Positioned buildDummyFreebieCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -131,7 +131,7 @@ Positioned buildDummyFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost.toStringAsFixed(2),
+ img.targetCost!.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -160,8 +160,8 @@ Positioned buildDummyFreebieCoupon(
AssetImage("assets/images/silver1.png"),
),
Text(
- CouponRateCalculator.getRate(img.targetCost *
- (img.lowerLimit / 100))
+ CouponRateCalculator.getRate(img.targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.black,
@@ -181,7 +181,7 @@ Positioned buildDummyFreebieCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -225,7 +225,7 @@ Positioned buildDummyFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition.replaceAll('"', ""),
+ img.condition!.replaceAll('"', ""),
),
),
],
diff --git a/lib/Pages/PageWidgets/Inbox/inboxTile.dart b/lib/Pages/PageWidgets/Inbox/inboxTile.dart
index 520a178..06eda5d 100644
--- a/lib/Pages/PageWidgets/Inbox/inboxTile.dart
+++ b/lib/Pages/PageWidgets/Inbox/inboxTile.dart
@@ -22,14 +22,14 @@ buildInboxTile(BuildContext context, InboxMessage message, bool read) {
child: message.thumbnail == null
? Center(
child: Text(
- message.firstname.characters
+ message.firstname!.characters
.characterAt(0)
.toString()
.toUpperCase(),
),
)
: CachedNetworkImage(
- imageUrl: userdpURL + message.thumbnail,
+ imageUrl: userdpURL + message.thumbnail!,
imageBuilder: (context, imageProvider) => FadeInImage(
height: 90,
width: 90,
@@ -61,7 +61,7 @@ buildInboxTile(BuildContext context, InboxMessage message, bool read) {
child: Align(
alignment: Alignment.centerLeft,
child: Text(
- message.firstname + " " + message.surname,
+ message.firstname! + " " + message.surname!,
style: TextStyle(
fontSize: 12.5,
color: Theme.of(context).primaryColorLight,
@@ -76,10 +76,10 @@ buildInboxTile(BuildContext context, InboxMessage message, bool read) {
width: MediaQuery.of(context).size.width -
(MediaQuery.of(context).size.width * 0.35),
child: Text(
- message.message.length > 73
- ? message.message.substring(0, 73).toString() +
+ message.message!.length > 73
+ ? message.message!.substring(0, 73).toString() +
"...."
- : message.message,
+ : message.message!,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 11,
@@ -99,7 +99,7 @@ buildInboxTile(BuildContext context, InboxMessage message, bool read) {
// padding: EdgeInsets.symmetric(horizontal: 20.0),
child: Center(
child: Text(
- TimeElapsed.fromDateTime(message.timestamp),
+ TimeElapsed.fromDateTime(message.timestamp!),
style: TextStyle(
color:
Theme.of(context).colorScheme.secondary,
@@ -132,7 +132,7 @@ buildInboxTile(BuildContext context, InboxMessage message, bool read) {
height: 30,
child: Center(
child: Text(
- TimeElapsed.fromDateTime(message.timestamp),
+ TimeElapsed.fromDateTime(message.timestamp!),
),
),
),
diff --git a/lib/Pages/PageWidgets/Login/passwordSignUP.dart b/lib/Pages/PageWidgets/Login/passwordSignUP.dart
index 81c0b99..bc8caa8 100644
--- a/lib/Pages/PageWidgets/Login/passwordSignUP.dart
+++ b/lib/Pages/PageWidgets/Login/passwordSignUP.dart
@@ -19,7 +19,7 @@ createPassword(BuildContext context, TextEditingController password) {
borderSide: BorderSide(color: accentMain, width: 1.0),
),
enabledBorder: OutlineInputBorder(
- borderSide: BorderSide(color: Colors.blueGrey[400], width: 1.0),
+ borderSide: BorderSide(color: Colors.blueGrey[400]!, width: 1.0),
),
//contentPadding: EdgeInsets.only(top: 8.0),
),
diff --git a/lib/Pages/PageWidgets/Login/phonenumber.dart b/lib/Pages/PageWidgets/Login/phonenumber.dart
index 10d6b70..78cd9c3 100644
--- a/lib/Pages/PageWidgets/Login/phonenumber.dart
+++ b/lib/Pages/PageWidgets/Login/phonenumber.dart
@@ -37,7 +37,7 @@ inputTelNumber(
theme: CountryTheme(
isShowFlag: true, isShowCode: true, isShowTitle: false),
//initialSelection: user.currentUser.country,
- onChanged: (CountryCode code) => countryPrefix(code)),
+ onChanged: (CountryCode? code) => countryPrefix(code)),
),
// suffix: InkWell(
// onTap: () => user.clear(),
diff --git a/lib/Pages/PageWidgets/Login/validation.dart b/lib/Pages/PageWidgets/Login/validation.dart
index b24ca27..f41ada4 100644
--- a/lib/Pages/PageWidgets/Login/validation.dart
+++ b/lib/Pages/PageWidgets/Login/validation.dart
@@ -12,10 +12,10 @@ class ValidationItem extends StatefulWidget {
class _ValidationItemState extends State
with TickerProviderStateMixin {
- AnimationController _controller;
- AnimationController _strikeController;
- Animation _spaceWidth;
- Animation _strikePercent;
+ late AnimationController _controller;
+ late AnimationController _strikeController;
+ late Animation _spaceWidth;
+ late Animation _strikePercent;
@override
void didUpdateWidget(ValidationItem oldWidget) {
diff --git a/lib/Pages/PageWidgets/Personal/header.dart b/lib/Pages/PageWidgets/Personal/header.dart
index 0a14cdb..750e058 100644
--- a/lib/Pages/PageWidgets/Personal/header.dart
+++ b/lib/Pages/PageWidgets/Personal/header.dart
@@ -1,3 +1,5 @@
+// ignore_for_file: unnecessary_null_comparison
+
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:teso/util/SizeConfig.dart';
@@ -6,7 +8,7 @@ buildProfileHeader(
BuildContext context,
String gold,
String silver,
- String username,
+ String? username,
String bytes,
String friends,
String fullname,
@@ -29,13 +31,13 @@ buildProfileHeader(
child: bytes == null
? Center(
child: Text(
- username.characters.characterAt(0).toString().toUpperCase(),
+ username!.characters.characterAt(0).toString().toUpperCase(),
),
)
: bytes == "null"
? Center(
child: Text(
- username.characters
+ username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
@@ -105,48 +107,6 @@ buildProfileHeader(
SizedBox(
height: 5,
),
- Container(
- height: 18,
- width: double.infinity,
- // transform: Matrix4.translationValues(0.0, -25.0, 0.0),
- margin:
- EdgeInsets.only(left: MediaQuery.of(context).size.width / 3.5),
- child: Center(
- child: Row(
- children: [
- Image(
- image: AssetImage("assets/images/gold1.png"),
- ),
- Container(
- child: Center(
- child: Text(
- "Gold Coins : ",
- style: TextStyle(
- fontSize: SizeConfig.blockSizeHorizontal * 3.8,
- fontWeight: FontWeight.w600,
- ),
- ),
- ),
- ),
- Container(
- margin: EdgeInsets.only(left: 5),
- child: Center(
- child: Text(
- gold,
- style: TextStyle(
- fontSize: SizeConfig.blockSizeHorizontal * 3.8,
- fontWeight: FontWeight.w600,
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- SizedBox(
- height: 5,
- ),
Container(
height: 18,
width: double.infinity,
diff --git a/lib/Pages/PageWidgets/ProximityList/ActiveDiscount.dart b/lib/Pages/PageWidgets/ProximityList/ActiveDiscount.dart
index b399621..0731e7e 100644
--- a/lib/Pages/PageWidgets/ProximityList/ActiveDiscount.dart
+++ b/lib/Pages/PageWidgets/ProximityList/ActiveDiscount.dart
@@ -29,8 +29,8 @@ Positioned buildActiveDiscountCoupon(
double worth,
Function calWorth) {
SizeConfig().init(context);
- if (worth < img.lowerLimit) {
- worth = img.lowerLimit;
+ if (worth < img.lowerLimit!) {
+ worth = img.lowerLimit!;
}
return new Positioned(
bottom: bottom,
@@ -67,7 +67,7 @@ Positioned buildActiveDiscountCoupon(
InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.business.businessId;
+ head.businessId = img.business!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
@@ -78,7 +78,7 @@ Positioned buildActiveDiscountCoupon(
head.type = img.type;
CouponDetails details = new CouponDetails();
- details.businessId = img.business.businessId;
+ details.businessId = img.business!.businessId;
details.countID = "null";
details.couponId = img.couponId;
details.expiration = img.expiration;
@@ -89,11 +89,11 @@ Positioned buildActiveDiscountCoupon(
details.state = img.state;
details.type = img.type;
details.targetProduct = new Product();
- details.targetProduct.businessID = details.businessId;
- details.targetProduct.productImage = img.targetImage;
- details.targetProduct.productName = img.targetName;
- details.targetProduct.unitPrice = img.targetCost;
- details.targetProduct.productDesc = img.tagretDescription;
+ details.targetProduct!.businessID = details.businessId;
+ details.targetProduct!.productImage = img.targetImage;
+ details.targetProduct!.productName = img.targetName;
+ details.targetProduct!.unitPrice = img.targetCost;
+ details.targetProduct!.productDesc = img.tagretDescription;
await Provider.of(context, listen: false)
.viewCoupon(head);
@@ -145,7 +145,7 @@ Positioned buildActiveDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage(
@@ -202,7 +202,7 @@ Positioned buildActiveDiscountCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -244,7 +244,7 @@ Positioned buildActiveDiscountCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost
+ img.targetCost!
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -256,8 +256,8 @@ Positioned buildActiveDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetCost -
- (img.targetCost *
+ (img.targetCost! -
+ (img.targetCost! *
(worth / 100)))
.toStringAsFixed(2),
style: TextStyle(
@@ -301,7 +301,7 @@ Positioned buildActiveDiscountCoupon(
child: Text(
CouponRateCalculator
.getRate(
- img.targetCost *
+ img.targetCost! *
(worth /
100))
.toString(),
@@ -330,7 +330,7 @@ Positioned buildActiveDiscountCoupon(
.width *
0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -368,8 +368,8 @@ Positioned buildActiveDiscountCoupon(
Container(
child: Text(
"Pay : GH¢ " +
- (img.targetCost -
- (img.targetCost *
+ (img.targetCost! -
+ (img.targetCost! *
(worth /
100)))
.toStringAsFixed(2) +
@@ -385,7 +385,7 @@ Positioned buildActiveDiscountCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition
+ img.condition!
.replaceAll(
'"', ""),
),
@@ -492,8 +492,8 @@ Positioned buildActiveDiscountCoupon(
quarterTurns: 3,
child: Slider(
value: worth,
- min: img.lowerLimit,
- max: img.upperLimit,
+ min: img.lowerLimit!,
+ max: img.upperLimit!,
divisions: 20,
activeColor: accentMain,
inactiveColor: darkAccent,
diff --git a/lib/Pages/PageWidgets/ProximityList/ActiveFreebie.dart b/lib/Pages/PageWidgets/ProximityList/ActiveFreebie.dart
index 71cbd50..f31b7d8 100644
--- a/lib/Pages/PageWidgets/ProximityList/ActiveFreebie.dart
+++ b/lib/Pages/PageWidgets/ProximityList/ActiveFreebie.dart
@@ -77,7 +77,7 @@ Positioned buildActiveFreebieCoupon(
child: InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.business.businessId;
+ head.businessId = img.business!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
@@ -88,7 +88,7 @@ Positioned buildActiveFreebieCoupon(
head.type = img.type;
CouponDetails details = new CouponDetails();
- details.businessId = img.business.businessId;
+ details.businessId = img.business!.businessId;
details.countID = "null";
details.couponId = img.couponId;
details.expiration = img.expiration;
@@ -99,11 +99,11 @@ Positioned buildActiveFreebieCoupon(
details.state = img.state;
details.type = img.type;
details.targetProduct = new Product();
- details.targetProduct.businessID = details.businessId;
- details.targetProduct.productImage = img.targetImage;
- details.targetProduct.productName = img.targetName;
- details.targetProduct.unitPrice = img.targetCost;
- details.targetProduct.productDesc = img.tagretDescription;
+ details.targetProduct!.businessID = details.businessId;
+ details.targetProduct!.productImage = img.targetImage;
+ details.targetProduct!.productName = img.targetName;
+ details.targetProduct!.unitPrice = img.targetCost;
+ details.targetProduct!.productDesc = img.tagretDescription;
await Provider.of(context, listen: false)
.viewCoupon(head);
@@ -176,7 +176,7 @@ Positioned buildActiveFreebieCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -217,7 +217,7 @@ Positioned buildActiveFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost.toStringAsFixed(2),
+ img.targetCost!.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -267,8 +267,8 @@ Positioned buildActiveFreebieCoupon(
),
child: Text(
CouponRateCalculator.getRate(img
- .targetCost *
- (img.lowerLimit / 100))
+ .targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.black,
@@ -293,7 +293,7 @@ Positioned buildActiveFreebieCoupon(
MediaQuery.of(context).size.width *
0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -338,7 +338,7 @@ Positioned buildActiveFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition
+ img.condition!
.replaceAll('"', ""),
),
),
diff --git a/lib/Pages/PageWidgets/ProximityList/DummyDiscount.dart b/lib/Pages/PageWidgets/ProximityList/DummyDiscount.dart
index 1ea7bb2..ee6c5d3 100644
--- a/lib/Pages/PageWidgets/ProximityList/DummyDiscount.dart
+++ b/lib/Pages/PageWidgets/ProximityList/DummyDiscount.dart
@@ -13,7 +13,7 @@ Positioned buildDummyDiscountCoupon(
double skew,
BuildContext context,
String discount,
- double selectedDiscount) {
+ double? selectedDiscount) {
return new Positioned(
bottom: 60 + bottom,
child: Container(
@@ -45,7 +45,7 @@ Positioned buildDummyDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -93,7 +93,7 @@ Positioned buildDummyDiscountCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -140,9 +140,9 @@ Positioned buildDummyDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetCost -
- (img.targetCost *
- (img.lowerLimit / 100)))
+ (img.targetCost! -
+ (img.targetCost! *
+ (img.lowerLimit! / 100)))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -165,8 +165,8 @@ Positioned buildDummyDiscountCoupon(
AssetImage("assets/images/silver1.png"),
),
Text(
- CouponRateCalculator.getRate(img.targetCost *
- (img.lowerLimit / 100))
+ CouponRateCalculator.getRate(img.targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.white,
@@ -185,7 +185,7 @@ Positioned buildDummyDiscountCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetName,
+ img.targetName!,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -218,7 +218,7 @@ Positioned buildDummyDiscountCoupon(
Container(
child: Text(
"Price : GH¢ " +
- (img.targetCost * (img.lowerLimit / 100))
+ (img.targetCost! * (img.lowerLimit! / 100))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -232,7 +232,7 @@ Positioned buildDummyDiscountCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition.replaceAll('"', ""),
+ img.condition!.replaceAll('"', ""),
),
),
],
diff --git a/lib/Pages/PageWidgets/ProximityList/DummyFreebie.dart b/lib/Pages/PageWidgets/ProximityList/DummyFreebie.dart
index 8dd01f7..6576d12 100644
--- a/lib/Pages/PageWidgets/ProximityList/DummyFreebie.dart
+++ b/lib/Pages/PageWidgets/ProximityList/DummyFreebie.dart
@@ -14,7 +14,7 @@ Positioned buildDummyFreebieCoupon(
double skew,
BuildContext context,
String discount,
- double selectedDiscount) {
+ double? selectedDiscount) {
return new Positioned(
bottom: 60.0 + bottom,
child: Container(
@@ -87,7 +87,7 @@ Positioned buildDummyFreebieCoupon(
child: Column(
children: [
Text(
- img.business.businessName,
+ img.business!.businessName!,
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -129,7 +129,7 @@ Positioned buildDummyFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetCost.toStringAsFixed(2),
+ img.targetCost!.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -158,8 +158,8 @@ Positioned buildDummyFreebieCoupon(
AssetImage("assets/images/silver1.png"),
),
Text(
- CouponRateCalculator.getRate(img.targetCost *
- (img.lowerLimit / 100))
+ CouponRateCalculator.getRate(img.targetCost! *
+ (img.lowerLimit! / 100))
.toString(),
style: TextStyle(
color: Colors.black,
@@ -179,7 +179,7 @@ Positioned buildDummyFreebieCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetName.toUpperCase(),
+ img.targetName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -223,7 +223,7 @@ Positioned buildDummyFreebieCoupon(
: Container(
child: Text(
"Condition : " +
- img.condition.replaceAll('"', ""),
+ img.condition!.replaceAll('"', ""),
),
),
],
diff --git a/lib/Pages/PageWidgets/Recently Viewed/viewedItem.dart b/lib/Pages/PageWidgets/Recently Viewed/viewedItem.dart
index 90f2d5a..5b702d5 100644
--- a/lib/Pages/PageWidgets/Recently Viewed/viewedItem.dart
+++ b/lib/Pages/PageWidgets/Recently Viewed/viewedItem.dart
@@ -7,7 +7,7 @@ import 'package:teso/Classes/API Clasess/CouponHead.dart';
buildRecentItem(
BuildContext context, CouponDetails couponDetails, Function purchase) {
bool active;
- if (couponDetails.quantity > 0) {
+ if (couponDetails.quantity! > 0) {
active = true;
} else {
active = false;
@@ -40,7 +40,7 @@ buildRecentItem(
bottomRight: Radius.circular(30),
),
child: CachedNetworkImage(
- imageUrl: productURL + couponDetails.targetProduct.productImage,
+ imageUrl: productURL + couponDetails.targetProduct!.productImage!,
imageBuilder: (context, imageProvider) => Image(
width: MediaQuery.of(context).size.width * 0.28,
height: 110,
@@ -69,7 +69,7 @@ buildRecentItem(
child: Align(
alignment: Alignment.centerLeft,
child: Text(
- couponDetails.issuer.businessName,
+ couponDetails.issuer!.businessName!,
style: TextStyle(
fontSize: 12.5,
color: Colors.grey,
@@ -102,7 +102,7 @@ buildRecentItem(
width: MediaQuery.of(context).size.width -
(MediaQuery.of(context).size.width * 0.35),
child: Text(
- couponDetails.targetProduct.productName,
+ couponDetails.targetProduct!.productName!,
textAlign: TextAlign.left,
),
),
@@ -111,7 +111,7 @@ buildRecentItem(
(MediaQuery.of(context).size.width * 0.35),
child: Text(
"Cost : GH¢ " +
- couponDetails.targetProduct.unitPrice.toString(),
+ couponDetails.targetProduct!.unitPrice.toString(),
textAlign: TextAlign.left,
),
),
@@ -141,9 +141,9 @@ buildRecentItem(
couponHeads.type = couponDetails.type;
couponHeads.quantity = 1;
couponHeads.targetProduct =
- couponDetails.targetProduct.productID;
+ couponDetails.targetProduct!.productID;
purchase(context, couponHeads,
- couponDetails.targetProduct.unitPrice);
+ couponDetails.targetProduct!.unitPrice);
},
child: Text("Acquire Coupon"),
),
diff --git a/lib/Pages/PageWidgets/Redeem/activeCard.dart b/lib/Pages/PageWidgets/Redeem/activeCard.dart
index 42f8bb3..abd963d 100644
--- a/lib/Pages/PageWidgets/Redeem/activeCard.dart
+++ b/lib/Pages/PageWidgets/Redeem/activeCard.dart
@@ -59,7 +59,7 @@ Positioned activeCard(
turns: new AlwaysStoppedAnimation(
flag == 0 ? rotation / 360 : -rotation / 360),
child: new Hero(
- tag: img.couponId,
+ tag: img.couponId!,
child: new GestureDetector(
// onTap: () {
// // Navigator.push(
@@ -161,7 +161,7 @@ Positioned activeCard(
width: double.infinity,
child: Center(
child: Text(
- img.targetName,
+ img.targetName!,
style: TextStyle(
fontSize: 18, color: Colors.white),
),
@@ -226,7 +226,7 @@ Positioned activeCard(
),
primary: Colors.red,
padding: new EdgeInsets.all(10.0),),
- onPressed: swipeLeft,
+ onPressed: swipeLeft as void Function()?,
child: new Container(
height: 30.0,
width: 100.0,
@@ -247,7 +247,7 @@ Positioned activeCard(
),
primary: Colors.green[200],
padding: new EdgeInsets.all(10.0),),
- onPressed: swipeRight,
+ onPressed: swipeRight as void Function()?,
child: new Container(
height: 30.0,
width: 100.0,
diff --git a/lib/Pages/PageWidgets/Redeem/detail.dart b/lib/Pages/PageWidgets/Redeem/detail.dart
index 09f7e67..40c68b9 100644
--- a/lib/Pages/PageWidgets/Redeem/detail.dart
+++ b/lib/Pages/PageWidgets/Redeem/detail.dart
@@ -5,8 +5,8 @@ import 'package:teso/util/consts.dart';
import 'package:teso/Classes/API Clasess/CouponDetails.dart';
class DetailPage extends StatefulWidget {
- final CouponDetails type;
- const DetailPage({Key key, this.type}) : super(key: key);
+ final CouponDetails? type;
+ const DetailPage({Key? key, this.type}) : super(key: key);
@override
_DetailPageState createState() => new _DetailPageState(type: type);
}
@@ -14,10 +14,10 @@ class DetailPage extends StatefulWidget {
enum AppBarBehavior { normal, pinned, floating, snapping }
class _DetailPageState extends State with TickerProviderStateMixin {
- AnimationController _containerController;
- Animation width;
- Animation heigth;
- CouponDetails type;
+ late AnimationController _containerController;
+ late Animation width;
+ late Animation heigth;
+ CouponDetails? type;
_DetailPageState({this.type});
double _appBarHeight = 256.0;
AppBarBehavior _appBarBehavior = AppBarBehavior.pinned;
@@ -73,7 +73,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
height: heigth.value,
//color: const Color.fromRGBO(106, 94, 175, 1.0),
child: new Hero(
- tag: type.couponId,
+ tag: type!.couponId!,
child: new Card(
color: Colors.transparent,
child: new Container(
@@ -120,7 +120,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
child: Align(
alignment: Alignment.bottomCenter,
child: new Text(
- type.targetProduct.productName,
+ type!.targetProduct!.productName!,
// style: TextStyle(
// // color: Theme.of(context).accentColor),
),
@@ -136,7 +136,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
decoration: new BoxDecoration(
image: DecorationImage(
image: NetworkImage(productURL +
- type.targetProduct.productImage),
+ type!.targetProduct!.productImage!),
fit: BoxFit.fill,
),
),
@@ -177,7 +177,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
padding:
const EdgeInsets.all(8.0),
child: new Text("GH¢ " +
- type.targetProduct.unitPrice
+ type!.targetProduct!.unitPrice
.toString()),
)
],
@@ -185,7 +185,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
new Padding(
padding: const EdgeInsets.all(8.0),
child: new Text(
- type.worth.toString() + "% off"),
+ type!.worth.toString() + "% off"),
),
new Row(
children: [
@@ -199,7 +199,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
padding:
const EdgeInsets.all(8.0),
child: new Text(
- type.issuer.businessName),
+ type!.issuer!.businessName!),
)
],
),
@@ -230,7 +230,7 @@ class _DetailPageState extends State with TickerProviderStateMixin {
fontWeight: FontWeight.bold),
),
),
- new Text(type.targetProduct.productDesc),
+ new Text(type!.targetProduct!.productDesc!),
new Container(
margin: new EdgeInsets.only(top: 25.0),
padding: new EdgeInsets.only(
diff --git a/lib/Pages/PageWidgets/Redeem/discountCoupon.dart b/lib/Pages/PageWidgets/Redeem/discountCoupon.dart
index 4f13547..d3ed2bc 100644
--- a/lib/Pages/PageWidgets/Redeem/discountCoupon.dart
+++ b/lib/Pages/PageWidgets/Redeem/discountCoupon.dart
@@ -21,7 +21,7 @@ Positioned buildCoupon(
Function swipeLeft,
String discount,
) {
- img.productCost = img.targetProduct.unitPrice;
+ img.productCost = img.targetProduct!.unitPrice;
Size screenSize = MediaQuery.of(context).size;
return new Positioned(
bottom: 45.0 + bottom,
@@ -59,14 +59,14 @@ Positioned buildCoupon(
InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.issuer.businessId;
+ head.businessId = img.issuer!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
head.upper = img.upperLimit;
head.quantity = img.quantity;
head.state = img.state;
- head.targetProduct = img.targetProduct.productID;
+ head.targetProduct = img.targetProduct!.productID;
head.type = img.type;
await Provider.of(context, listen: false)
.viewCoupon(head);
@@ -161,7 +161,7 @@ Positioned buildCoupon(
width: double.infinity,
child: Center(
child: Text(
- img.targetProduct.productName,
+ img.targetProduct!.productName!,
style: TextStyle(
fontSize: 18, color: Colors.white),
),
@@ -173,7 +173,7 @@ Positioned buildCoupon(
child: Center(
child: Text(
"Item Original Price : " +
- img.targetProduct.unitPrice.toString(),
+ img.targetProduct!.unitPrice.toString(),
style: TextStyle(
fontSize: 18, color: Colors.white),
),
@@ -227,7 +227,7 @@ Positioned buildCoupon(
),
primary: Colors.red,
padding: new EdgeInsets.all(10.0),),
- onPressed: swipeLeft,
+ onPressed: swipeLeft as void Function()?,
child: new Container(
height: 30.0,
width: 100.0,
@@ -248,7 +248,7 @@ Positioned buildCoupon(
),
primary: Colors.green[200],
padding: new EdgeInsets.all(10.0),),
- onPressed: swipeRight,
+ onPressed: swipeRight as void Function()?,
child: new Container(
height: 30.0,
width: 100.0,
diff --git a/lib/Pages/PageWidgets/Redeem/dummyCard.dart b/lib/Pages/PageWidgets/Redeem/dummyCard.dart
index 4087b30..cb69666 100644
--- a/lib/Pages/PageWidgets/Redeem/dummyCard.dart
+++ b/lib/Pages/PageWidgets/Redeem/dummyCard.dart
@@ -121,7 +121,7 @@ Positioned cardDemoDummy(
width: double.infinity,
child: Center(
child: Text(
- img.targetName,
+ img.targetName!,
style: TextStyle(fontSize: 18, color: Colors.white),
),
),
diff --git a/lib/Pages/PageWidgets/Redeem/scannedDummy.dart b/lib/Pages/PageWidgets/Redeem/scannedDummy.dart
index b4ce0c3..8ea74e0 100644
--- a/lib/Pages/PageWidgets/Redeem/scannedDummy.dart
+++ b/lib/Pages/PageWidgets/Redeem/scannedDummy.dart
@@ -121,7 +121,7 @@ Positioned cardDemoDummy(
width: double.infinity,
child: Center(
child: Text(
- img.targetProduct.productName,
+ img.targetProduct!.productName!,
style: TextStyle(fontSize: 18, color: Colors.white),
),
),
@@ -133,7 +133,7 @@ Positioned cardDemoDummy(
child: Text(
"Item Original Price : " +
"GH¢ " +
- img.targetProduct.unitPrice.toString(),
+ img.targetProduct!.unitPrice.toString(),
style: TextStyle(fontSize: 18, color: Colors.white),
),
),
diff --git a/lib/Pages/PageWidgets/Settings/AccountSettings.dart b/lib/Pages/PageWidgets/Settings/AccountSettings.dart
index 8296dd7..fc21028 100644
--- a/lib/Pages/PageWidgets/Settings/AccountSettings.dart
+++ b/lib/Pages/PageWidgets/Settings/AccountSettings.dart
@@ -1,3 +1,5 @@
+import 'dart:async';
+
import 'package:country_list_pick/country_list_pick.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -14,7 +16,7 @@ class AccountSettings extends StatefulWidget {
}
class _AccountSettingsState extends State {
- bool show = false;
+ bool? show = false;
@override
void initState() {
@@ -30,7 +32,7 @@ class _AccountSettingsState extends State {
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of(context);
return Consumer(
- builder: (BuildContext context, UserProvider user, Widget child) {
+ builder: (BuildContext context, UserProvider user, Widget? child) {
return Container(
height: MediaQuery.of(context).size.height * 0.9,
child: SingleChildScrollView(
@@ -74,10 +76,10 @@ class _AccountSettingsState extends State {
trailing: CountryListPick(
theme: CountryTheme(
isShowFlag: true, isShowCode: true, isShowTitle: true),
- initialSelection: user.currentUser.country,
- onChanged: (CountryCode code) {
- TesoUser newuser = user.currentUser;
- newuser.country = code.dialCode;
+ initialSelection: user.currentUser!.country,
+ onChanged: (CountryCode? code) {
+ TesoUser newuser = user.currentUser!;
+ newuser.country = code!.dialCode;
Provider.of(context, listen: false)
.updateUser(newuser);
},
@@ -89,7 +91,7 @@ class _AccountSettingsState extends State {
spacing: 10,
children: [
new Text(
- userProvider.currentUser.gender,
+ userProvider.currentUser!.gender!,
style: TextStyle(
fontSize: 16,
),
@@ -99,8 +101,8 @@ class _AccountSettingsState extends State {
),
title: new Text('Gender'),
onTap: () async {
- int orientation = 5;
- switch (userProvider.currentUser.gender) {
+ int? orientation = 5;
+ switch (userProvider.currentUser!.gender) {
case "Male":
orientation = 0;
break;
@@ -111,7 +113,7 @@ class _AccountSettingsState extends State {
orientation = 2;
break;
}
- orientation = await Navigator.push(
+ orientation = await (Navigator.push(
context,
PageTransition(
child: Gender(
@@ -119,13 +121,13 @@ class _AccountSettingsState extends State {
),
type: PageTransitionType.leftToRight,
),
- );
- TesoUser newuser = user.currentUser;
+ ) as FutureOr);
+ TesoUser? newuser = user.currentUser;
Provider.of(context, listen: false)
.updateUser(newuser);
}),
Visibility(
- visible: show,
+ visible: show!,
child: new ListTile(
trailing: new Icon(Icons.arrow_forward_ios),
title: new Text('Change password'),
diff --git a/lib/Pages/PageWidgets/Settings/EditProfile.dart b/lib/Pages/PageWidgets/Settings/EditProfile.dart
index 64ccd16..61af188 100644
--- a/lib/Pages/PageWidgets/Settings/EditProfile.dart
+++ b/lib/Pages/PageWidgets/Settings/EditProfile.dart
@@ -16,9 +16,9 @@ import 'package:teso/providers/user_provider.dart';
import 'package:teso/util/consts.dart';
class EditProfile extends StatefulWidget {
- final TesoUser userProfile;
- final List connectedCameras;
- const EditProfile({Key key, this.userProfile, this.connectedCameras})
+ final TesoUser? userProfile;
+ final List? connectedCameras;
+ const EditProfile({Key? key, this.userProfile, this.connectedCameras})
: super(key: key);
@override
_EditProfileState createState() =>
@@ -32,12 +32,12 @@ enum AppState {
}
class _EditProfileState extends State {
- TesoUser userProfile;
+ TesoUser? userProfile;
_EditProfileState({this.userProfile});
- AppState state;
+ AppState? state;
bool imageAvailable = false;
- File _image;
- String thumb;
+ File? _image;
+ String? thumb;
bool passed = false;
bool failed = false;
final picker = ImagePicker();
@@ -54,7 +54,7 @@ class _EditProfileState extends State {
context,
PageTransition(
type: PageTransitionType.leftToRight,
- child: TakeDP(connectedCameras: widget.connectedCameras),
+ child: TakeDP(connectedCameras: widget.connectedCameras!),
));
if (pickedFile != null) {
@@ -68,8 +68,8 @@ class _EditProfileState extends State {
Future _cropImage() async {
ImageCropper imageCropper = new ImageCropper();
- CroppedFile croppedFile = await imageCropper.cropImage(
- sourcePath: _image.path,
+ CroppedFile? croppedFile = await imageCropper.cropImage(
+ sourcePath: _image!.path,
cropStyle: CropStyle.circle,
aspectRatioPresets: Platform.isAndroid
? [CropAspectRatioPreset.original]
@@ -105,15 +105,15 @@ class _EditProfileState extends State {
Future _updateUser() async {
try {
- String thumbnail;
+ String? thumbnail;
if (_image != null) {
- List imageBytes = await _image.readAsBytes();
+ List imageBytes = await _image!.readAsBytes();
thumbnail = base64Encode(imageBytes);
} else if (thumb != null) {
thumbnail = thumb;
}
TesoUser updateuser = new TesoUser();
- updateuser.userGUID = userProfile.userGUID;
+ updateuser.userGUID = userProfile!.userGUID;
updateuser.username = username.text;
updateuser.firstname = firstname.text;
updateuser.lastname = surname.text;
@@ -121,14 +121,14 @@ class _EditProfileState extends State {
updateuser.description = description.text;
updateuser.email = email.text;
updateuser.phonenumber = telephone.text;
- updateuser.gold = userProfile.gold;
- updateuser.silver = userProfile.silver;
- updateuser.friends = userProfile.friends;
+ updateuser.gold = userProfile!.gold;
+ updateuser.silver = userProfile!.silver;
+ updateuser.friends = userProfile!.friends;
updateuser.displaypicture = thumbnail;
- updateuser.thumbnail_dp = userProfile.thumbnail_dp;
- updateuser.country = userProfile.country;
- updateuser.gender = userProfile.gender;
- updateuser.dateOfBirth = userProfile.dateOfBirth;
+ updateuser.thumbnail_dp = userProfile!.thumbnail_dp;
+ updateuser.country = userProfile!.country;
+ updateuser.gender = userProfile!.gender;
+ updateuser.dateOfBirth = userProfile!.dateOfBirth;
print(updateuser.toString());
UserProvider userProvider =
Provider.of(context, listen: false);
@@ -171,14 +171,14 @@ class _EditProfileState extends State {
@override
void initState() {
- username.text = userProfile.username.toString();
- firstname.text = userProfile.firstname;
- surname.text = userProfile.lastname;
- address.text = userProfile.address;
- email.text = userProfile.email;
- telephone.text = userProfile.phonenumber;
- description.text = userProfile.description;
- thumb = userProfile.thumbnail_dp;
+ username.text = userProfile!.username.toString();
+ firstname.text = userProfile!.firstname!;
+ surname.text = userProfile!.lastname!;
+ address.text = userProfile!.address!;
+ email.text = userProfile!.email!;
+ telephone.text = userProfile!.phonenumber!;
+ description.text = userProfile!.description!;
+ thumb = userProfile!.thumbnail_dp;
super.initState();
}
@@ -336,7 +336,7 @@ class _EditProfileState extends State {
fit: BoxFit.fill,
image: FileImage(
File(
- _image.path,
+ _image!.path,
),
),
),
@@ -360,7 +360,7 @@ class _EditProfileState extends State {
width: 130,
fit: BoxFit.fill,
image:
- NetworkImage(userdpURL + thumb),
+ NetworkImage(userdpURL + thumb!),
placeholder: AssetImage(
"assets/images/tesoDP/dp1.png"),
),
diff --git a/lib/Pages/PageWidgets/Third Person Profile/header.dart b/lib/Pages/PageWidgets/Third Person Profile/header.dart
index a618388..8270ec0 100644
--- a/lib/Pages/PageWidgets/Third Person Profile/header.dart
+++ b/lib/Pages/PageWidgets/Third Person Profile/header.dart
@@ -4,19 +4,19 @@ import 'package:teso/util/consts.dart';
import 'package:flutter/material.dart';
buildHead(
- {BuildContext context,
- TesoUser user,
- String posts,
- List friends,
- List following,
- bool relation,
- bool pending,
- bool approveRequest,
- bool loading,
- Function unFriend,
- Function approve,
- Function cancelRequest,
- Function decline}) {
+ {required BuildContext context,
+ required TesoUser user,
+ String? posts,
+ List? friends,
+ List? following,
+ bool? relation,
+ bool? pending,
+ bool? approveRequest,
+ bool? loading,
+ Function? unFriend,
+ Function? approve,
+ Function? cancelRequest,
+ Function? decline}) {
return Container(
color: Theme.of(context).backgroundColor,
width: MediaQuery.of(context).size.width,
@@ -33,7 +33,7 @@ buildHead(
child: user.thumbnail_dp == null
? Center(
child: Text(
- user.username.characters
+ user.username!.characters
.characterAt(0)
.toString()
.toUpperCase(),
@@ -53,7 +53,7 @@ buildHead(
bottomRight: Radius.circular(40),
),
child: CachedNetworkImage(
- imageUrl: userdpURL + user.thumbnail_dp,
+ imageUrl: userdpURL + user.thumbnail_dp!,
imageBuilder: (context, imageProvider) => Image(
height: 70,
width: 70,
@@ -73,7 +73,7 @@ buildHead(
),
child: Center(
child: Text(
- user.firstname + " " + user.lastname,
+ user.firstname! + " " + user.lastname!,
style: TextStyle(
fontWeight: FontWeight.bold,
),
@@ -87,7 +87,7 @@ buildHead(
bottom: 10,
),
child: Text(
- user.description != null ? user.description : "",
+ user.description != null ? user.description! : "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
diff --git a/lib/Pages/PageWidgets/WalkIn Coupons/ActiveDiscount.dart b/lib/Pages/PageWidgets/WalkIn Coupons/ActiveDiscount.dart
index 44e1482..bc71eb1 100644
--- a/lib/Pages/PageWidgets/WalkIn Coupons/ActiveDiscount.dart
+++ b/lib/Pages/PageWidgets/WalkIn Coupons/ActiveDiscount.dart
@@ -13,7 +13,7 @@ buildActiveDiscountCoupon(
double cardWidth,
BuildContext context,
) {
- img.productCost = img.targetProduct.unitPrice;
+ img.productCost = img.targetProduct!.unitPrice;
return Container(
width: (MediaQuery.of(context).size.width * 0.80) - cardWidth,
height: MediaQuery.of(context).size.height * 0.68,
@@ -32,14 +32,14 @@ buildActiveDiscountCoupon(
InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.issuer.businessId;
+ head.businessId = img.issuer!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
head.upper = img.upperLimit;
head.quantity = img.quantity;
head.state = img.state;
- head.targetProduct = img.targetProduct.productID;
+ head.targetProduct = img.targetProduct!.productID;
head.type = img.type;
await Provider.of(context, listen: false)
.viewCoupon(head);
@@ -82,7 +82,7 @@ buildActiveDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -132,7 +132,7 @@ buildActiveDiscountCoupon(
child: Column(
children: [
Text(
- img.issuer.businessName.toUpperCase(),
+ img.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -171,7 +171,7 @@ buildActiveDiscountCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetProduct.unitPrice.toString(),
+ img.targetProduct!.unitPrice.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@@ -179,8 +179,8 @@ buildActiveDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetProduct.unitPrice *
- (img.lowerLimit / 100))
+ (img.targetProduct!.unitPrice! *
+ (img.lowerLimit! / 100))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -198,7 +198,7 @@ buildActiveDiscountCoupon(
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetProduct.productName.toUpperCase(),
+ img.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -231,8 +231,8 @@ buildActiveDiscountCoupon(
Container(
child: Text(
"Price : GH¢ " +
- (img.targetProduct.unitPrice *
- (img.lowerLimit / 100))
+ (img.targetProduct!.unitPrice! *
+ (img.lowerLimit! / 100))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -245,7 +245,7 @@ buildActiveDiscountCoupon(
? Container()
: Container(
child: Text(
- "Condition : " + img.condition,
+ "Condition : " + img.condition!,
),
),
],
diff --git a/lib/Pages/PageWidgets/WalkIn Coupons/ActiveFreebie.dart b/lib/Pages/PageWidgets/WalkIn Coupons/ActiveFreebie.dart
index aba4676..2169600 100644
--- a/lib/Pages/PageWidgets/WalkIn Coupons/ActiveFreebie.dart
+++ b/lib/Pages/PageWidgets/WalkIn Coupons/ActiveFreebie.dart
@@ -11,7 +11,7 @@ import 'package:teso/Pages/Sub_Pages/@Generic/RedeemingCoupon.dart';
buildActiveFreebieCoupon(
CouponDetails img, double cardWidth, BuildContext context) {
- img.productCost = img.targetProduct.unitPrice;
+ img.productCost = img.targetProduct!.unitPrice;
return Container(
width: (MediaQuery.of(context).size.width * 0.80) - cardWidth,
height: MediaQuery.of(context).size.height * 0.68,
@@ -22,14 +22,14 @@ buildActiveFreebieCoupon(
InkWell(
onTap: () async {
CouponsHead head = new CouponsHead();
- head.businessId = img.issuer.businessId;
+ head.businessId = img.issuer!.businessId;
head.couponId = img.couponId;
head.expiration = img.expiration;
head.lower = img.lowerLimit;
head.upper = img.upperLimit;
head.quantity = img.quantity;
head.state = img.state;
- head.targetProduct = img.targetProduct.productID;
+ head.targetProduct = img.targetProduct!.productID;
head.type = img.type;
await Provider.of(context, listen: false)
.viewCoupon(head);
@@ -107,7 +107,7 @@ buildActiveFreebieCoupon(
child: Column(
children: [
Text(
- img.issuer.businessName.toUpperCase(),
+ img.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -148,7 +148,7 @@ buildActiveFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetProduct.unitPrice
+ img.targetProduct!.unitPrice!
.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
@@ -173,7 +173,7 @@ buildActiveFreebieCoupon(
vertical:
MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetProduct.productName.toUpperCase(),
+ img.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -216,7 +216,7 @@ buildActiveFreebieCoupon(
? Container()
: Container(
child: Text(
- "Condition : " + img.condition,
+ "Condition : " + img.condition!,
),
),
],
diff --git a/lib/Pages/PageWidgets/WalkIn Coupons/DummyDiscount.dart b/lib/Pages/PageWidgets/WalkIn Coupons/DummyDiscount.dart
index fc3c9fe..c41d0e7 100644
--- a/lib/Pages/PageWidgets/WalkIn Coupons/DummyDiscount.dart
+++ b/lib/Pages/PageWidgets/WalkIn Coupons/DummyDiscount.dart
@@ -13,7 +13,7 @@ Positioned buildDummyDiscountCoupon(
BuildContext context,
String discount,
double selectedDiscount) {
- img.productCost = img.targetProduct.unitPrice;
+ img.productCost = img.targetProduct!.unitPrice;
return new Positioned(
bottom: 100.0 + bottom,
child: Container(
@@ -34,7 +34,7 @@ Positioned buildDummyDiscountCoupon(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
- image: img.upperLimit < 50.1
+ image: img.upperLimit! < 50.1
? DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/images/blue.png"),
@@ -82,7 +82,7 @@ Positioned buildDummyDiscountCoupon(
child: Column(
children: [
Text(
- img.issuer.businessName.toUpperCase(),
+ img.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontSize: 18,
@@ -121,7 +121,7 @@ Positioned buildDummyDiscountCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetProduct.unitPrice.toString(),
+ img.targetProduct!.unitPrice.toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@@ -129,8 +129,8 @@ Positioned buildDummyDiscountCoupon(
),
Text(
"DISCOUNTED PRICE : GH¢ " +
- (img.targetProduct.unitPrice *
- (img.lowerLimit / 100))
+ (img.targetProduct!.unitPrice! *
+ (img.lowerLimit! / 100))
.toStringAsFixed(2),
style: TextStyle(
color: Colors.white,
@@ -147,7 +147,7 @@ Positioned buildDummyDiscountCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetProduct.productName.toUpperCase(),
+ img.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -180,8 +180,8 @@ Positioned buildDummyDiscountCoupon(
Container(
child: Text(
"Price : GH¢ " +
- (img.targetProduct.unitPrice *
- (img.lowerLimit / 100))
+ (img.targetProduct!.unitPrice! *
+ (img.lowerLimit! / 100))
.toStringAsFixed(2) +
" only",
style: TextStyle(
@@ -194,7 +194,7 @@ Positioned buildDummyDiscountCoupon(
? Container()
: Container(
child: Text(
- "Condition : " + img.condition,
+ "Condition : " + img.condition!,
),
),
],
diff --git a/lib/Pages/PageWidgets/WalkIn Coupons/DummyFreebie.dart b/lib/Pages/PageWidgets/WalkIn Coupons/DummyFreebie.dart
index f084969..5115a80 100644
--- a/lib/Pages/PageWidgets/WalkIn Coupons/DummyFreebie.dart
+++ b/lib/Pages/PageWidgets/WalkIn Coupons/DummyFreebie.dart
@@ -14,7 +14,7 @@ Positioned buildDummyFreebieCoupon(
BuildContext context,
String discount,
double selectedDiscount) {
- img.productCost = img.targetProduct.unitPrice;
+ img.productCost = img.targetProduct!.unitPrice;
return new Positioned(
bottom: 80.0 + bottom,
child: Container(
@@ -74,7 +74,7 @@ Positioned buildDummyFreebieCoupon(
child: Column(
children: [
Text(
- img.issuer.businessName.toUpperCase(),
+ img.issuer!.businessName!.toUpperCase(),
style: TextStyle(
color: Colors.black,
fontSize: 18,
@@ -114,7 +114,7 @@ Positioned buildDummyFreebieCoupon(
children: [
Text(
"ORIGINAL PRICE : GH¢ " +
- img.targetProduct.unitPrice.toStringAsFixed(2),
+ img.targetProduct!.unitPrice!.toStringAsFixed(2),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -137,7 +137,7 @@ Positioned buildDummyFreebieCoupon(
margin: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).size.width * 0.15),
child: Text(
- img.targetProduct.productName.toUpperCase(),
+ img.targetProduct!.productName!.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
@@ -180,7 +180,7 @@ Positioned buildDummyFreebieCoupon(
? Container()
: Container(
child: Text(
- "Condition : " + img.condition,
+ "Condition : " + img.condition!,
),
),
],
diff --git a/lib/Pages/Personnal.dart b/lib/Pages/Personnal.dart
index ab752aa..83d4677 100644
--- a/lib/Pages/Personnal.dart
+++ b/lib/Pages/Personnal.dart
@@ -12,7 +12,7 @@ import 'package:provider/provider.dart';
class Personnal extends StatefulWidget {
final Function showSettings;
- const Personnal({Key key, this.showSettings}) : super(key: key);
+ const Personnal({Key? key, required this.showSettings}) : super(key: key);
@override
_PersonnalState createState() =>
_PersonnalState(showSettings: this.showSettings);
@@ -21,35 +21,35 @@ class Personnal extends StatefulWidget {
enum AppBarBehavior { normal, pinned, floating, snapping }
class _PersonnalState extends State with TickerProviderStateMixin {
- TesoUser currentUser;
+ TesoUser? currentUser;
Function showSettings;
- double scale;
- _PersonnalState({this.showSettings});
- double _appBarHeightSpecial = 275.0;
+ double? scale;
+ _PersonnalState({required this.showSettings});
+ double _appBarHeightSpecial = 270.0;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
- TabController tabsController;
+ TabController? tabsController;
Widget _randomHeightWidgets(BuildContext context) {
return Consumer(
- builder: (BuildContext context, UserProvider user, Widget child) {
+ builder: (BuildContext context, UserProvider user, Widget? child) {
user.getCurrentUser();
currentUser = user.currentUser;
if (user.currentUser == null || currentUser == null) {
return Container();
} else {
- String dp = userdpURL + currentUser.thumbnail_dp;
+ String dp = userdpURL + currentUser!.thumbnail_dp!;
return buildProfileHeader(
context,
- currentUser.gold,
- currentUser.silver,
- currentUser.username,
+ currentUser!.gold!,
+ currentUser!.silver!,
+ currentUser!.username,
dp,
- user.friends != null
+ user.friends.isNotEmpty
? user.friends.length.toString()
- : currentUser.friends,
- currentUser.firstname + " " + currentUser.lastname,
+ : currentUser!.friends!,
+ currentUser!.firstname! + " " + currentUser!.lastname!,
_appBarHeightSpecial);
}
});
@@ -58,7 +58,7 @@ class _PersonnalState extends State with TickerProviderStateMixin {
void _onRefresh() async {
Provider.of(context, listen: false).getUserInformation();
- switch (tabsController.index) {
+ switch (tabsController!.index) {
case 0:
Provider.of(context, listen: false).loadFriends();
Provider.of(context, listen: false).getCoupons();
@@ -81,7 +81,7 @@ class _PersonnalState extends State with TickerProviderStateMixin {
@override
void dispose() {
- tabsController.dispose();
+ tabsController!.dispose();
_refreshController.dispose();
super.dispose();
}
@@ -101,12 +101,12 @@ class _PersonnalState extends State with TickerProviderStateMixin {
automaticallyImplyLeading: false,
title: Consumer(
builder:
- (BuildContext context, UserProvider user, Widget child) {
+ (BuildContext context, UserProvider user, Widget? child) {
currentUser = user.currentUser;
if (user.currentUser == null || currentUser == null) {
return Container();
} else {
- return Text(user.currentUser.username,
+ return Text(user.currentUser!.username!,
style: TextStyle(
color: Theme.of(context).primaryColorLight,
));
diff --git a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/PictureReview.dart b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/PictureReview.dart
index 7b27dfc..f5f452f 100644
--- a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/PictureReview.dart
+++ b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/PictureReview.dart
@@ -4,7 +4,7 @@ import 'dart:io';
class PictureReview extends StatefulWidget {
final image;
- const PictureReview({Key key, this.image}) : super(key: key);
+ const PictureReview({Key? key, this.image}) : super(key: key);
@override
_PictureReviewState createState() => _PictureReviewState();
}
diff --git a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakeDP.dart b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakeDP.dart
index 973cd92..38d86fc 100644
--- a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakeDP.dart
+++ b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakeDP.dart
@@ -8,29 +8,29 @@ import 'package:image_picker/image_picker.dart';
class TakeDP extends StatefulWidget {
List connectedCameras;
- TakeDP({Key key, this.connectedCameras}) : super(key: key);
+ TakeDP({Key? key, required this.connectedCameras}) : super(key: key);
@override
_TakeDPState createState() => _TakeDPState();
}
class _TakeDPState extends State with TickerProviderStateMixin {
- CameraController _controller;
+ CameraController? _controller;
int selectedCamera = 0;
bool flash = false;
bool frontFlash = false;
double _currentScale = 1.0;
double _baseScale = 1.0;
- double _minAvailableZoom;
- double _maxAvailableZoom;
+ late double _minAvailableZoom;
+ late double _maxAvailableZoom;
int _pointers = 0;
final picker = ImagePicker();
setCamera(int camera) async {
_controller =
CameraController(widget.connectedCameras[camera], ResolutionPreset.max);
- _controller.initialize().then((_) {
- _controller.setFocusMode(FocusMode.auto);
+ _controller!.initialize().then((_) {
+ _controller!.setFocusMode(FocusMode.auto);
if (!mounted) {
return;
}
@@ -43,14 +43,14 @@ class _TakeDPState extends State with TickerProviderStateMixin {
details.localPosition.dx / constraints.maxWidth,
details.localPosition.dy / constraints.maxHeight,
);
- _controller.setExposurePoint(offset);
- _controller.setFocusPoint(offset);
+ _controller!.setExposurePoint(offset);
+ _controller!.setFocusPoint(offset);
}
@override
void initState() {
- if (widget.connectedCameras == null ||
- widget.connectedCameras.length == 0) {
+ if
+ (widget.connectedCameras.length == 0) {
availableCameras().then((value) {
widget.connectedCameras = value;
setCamera(0);
@@ -64,9 +64,9 @@ class _TakeDPState extends State with TickerProviderStateMixin {
sayCheese() async {
try {
- final image = await _controller.takePicture();
+ final image = await _controller!.takePicture();
- if (image != null) Navigator.pop(context, image);
+ Navigator.pop(context, image);
} catch (e) {
print(e);
}
@@ -85,7 +85,7 @@ class _TakeDPState extends State with TickerProviderStateMixin {
_currentScale = (_baseScale * details.scale)
.clamp(_minAvailableZoom, _maxAvailableZoom);
- await _controller.setZoomLevel(_currentScale);
+ await _controller!.setZoomLevel(_currentScale);
}
@override
@@ -96,7 +96,7 @@ class _TakeDPState extends State with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
- if (_controller == null || !_controller.value.isInitialized) {
+ if (_controller == null || !_controller!.value.isInitialized) {
return Container();
} else {
return Scaffold(
@@ -114,9 +114,9 @@ class _TakeDPState extends State with TickerProviderStateMixin {
child: InkWell(
onTap: () {
if (flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.off);
+ _controller!.setFlashMode(FlashMode.off);
setState(() {
flash = false;
});
@@ -153,23 +153,23 @@ class _TakeDPState extends State with TickerProviderStateMixin {
onTap: () {
try {
if (!flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.torch);
+ _controller!.setFlashMode(FlashMode.torch);
setState(() {
flash = true;
});
} else if (!flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.front) {
setState(() {
flash = true;
frontFlash = true;
});
} else if (flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.off);
+ _controller!.setFlashMode(FlashMode.off);
setState(() {
flash = false;
});
@@ -288,7 +288,7 @@ class _TakeDPState extends State with TickerProviderStateMixin {
}
Widget cameraWidget(context) {
- var camera = _controller.value;
+ var camera = _controller!.value;
final size = MediaQuery.of(context).size;
var scale = size.aspectRatio * camera.aspectRatio;
if (scale < 1) scale = 1 / scale;
@@ -297,7 +297,7 @@ class _TakeDPState extends State with TickerProviderStateMixin {
scale: scale,
child: Center(
child: CameraPreview(
- _controller,
+ _controller!,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return GestureDetector(
diff --git a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakePicture.dart b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakePicture.dart
index 04cff91..73efcc7 100644
--- a/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakePicture.dart
+++ b/lib/Pages/Sub_Pages/@Generic/Camera/Picture/TakePicture.dart
@@ -1,3 +1,5 @@
+import 'dart:async';
+
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
@@ -9,9 +11,9 @@ import 'dart:io';
// ignore: must_be_immutable
class TakePicture extends StatefulWidget {
- List connectedCameras;
+ List? connectedCameras;
- TakePicture({Key key, this.connectedCameras}) : super(key: key);
+ TakePicture({Key? key, this.connectedCameras}) : super(key: key);
@override
_TakePictureState createState() => _TakePictureState();
@@ -19,22 +21,22 @@ class TakePicture extends StatefulWidget {
class _TakePictureState extends State
with TickerProviderStateMixin {
- CameraController _controller;
+ CameraController? _controller;
int selectedCamera = 0;
bool flash = false;
bool frontFlash = false;
double _currentScale = 1.0;
double _baseScale = 1.0;
- double _minAvailableZoom;
- double _maxAvailableZoom;
+ late double _minAvailableZoom;
+ late double _maxAvailableZoom;
int _pointers = 0;
final picker = ImagePicker();
setCamera(int camera) async {
_controller =
- CameraController(widget.connectedCameras[camera], ResolutionPreset.max);
- _controller.initialize().then((_) {
- _controller.setFocusMode(FocusMode.auto);
+ CameraController(widget.connectedCameras![camera], ResolutionPreset.max);
+ _controller!.initialize().then((_) {
+ _controller!.setFocusMode(FocusMode.auto);
if (!mounted) {
return;
}
@@ -47,14 +49,14 @@ class _TakePictureState extends State
details.localPosition.dx / constraints.maxWidth,
details.localPosition.dy / constraints.maxHeight,
);
- _controller.setExposurePoint(offset);
- _controller.setFocusPoint(offset);
+ _controller!.setExposurePoint(offset);
+ _controller!.setFocusPoint(offset);
}
@override
void initState() {
if (widget.connectedCameras == null ||
- widget.connectedCameras.length == 0) {
+ widget.connectedCameras!.length == 0) {
availableCameras().then((value) {
widget.connectedCameras = value;
});
@@ -68,17 +70,17 @@ class _TakePictureState extends State
sayCheese() async {
try {
- final image = await _controller.takePicture();
+ final image = await _controller!.takePicture();
- bool result = false;
- result = await Navigator.push(
+ bool? result = false;
+ result = await (Navigator.push(
context,
PageTransition(
type: PageTransitionType.leftToRight,
child: PictureReview(
image: image.path,
),
- ));
+ )) as FutureOr);
if (result) Navigator.pop(context, image);
} catch (e) {
@@ -99,7 +101,7 @@ class _TakePictureState extends State
_currentScale = (_baseScale * details.scale)
.clamp(_minAvailableZoom, _maxAvailableZoom);
- await _controller.setZoomLevel(_currentScale);
+ await _controller!.setZoomLevel(_currentScale);
}
@override
@@ -110,7 +112,7 @@ class _TakePictureState extends State
@override
Widget build(BuildContext context) {
- if (_controller == null || !_controller.value.isInitialized) {
+ if (_controller == null || !_controller!.value.isInitialized) {
return Container();
} else {
return Scaffold(
@@ -137,9 +139,9 @@ class _TakePictureState extends State
child: InkWell(
onTap: () {
if (flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.off);
+ _controller!.setFlashMode(FlashMode.off);
setState(() {
flash = false;
});
@@ -150,7 +152,7 @@ class _TakePictureState extends State
});
}
selectedCamera++;
- if (selectedCamera < widget.connectedCameras.length) {
+ if (selectedCamera < widget.connectedCameras!.length) {
setCamera(selectedCamera);
} else {
selectedCamera = 0;
@@ -176,23 +178,23 @@ class _TakePictureState extends State
onTap: () {
try {
if (!flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.torch);
+ _controller!.setFlashMode(FlashMode.torch);
setState(() {
flash = true;
});
} else if (!flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.front) {
setState(() {
flash = true;
frontFlash = true;
});
} else if (flash &&
- _controller.description.lensDirection ==
+ _controller!.description.lensDirection ==
CameraLensDirection.back) {
- _controller.setFlashMode(FlashMode.off);
+ _controller!.setFlashMode(FlashMode.off);
setState(() {
flash = false;
});
@@ -291,7 +293,7 @@ class _TakePictureState extends State
if (pickedFile != null) {
final image = File(pickedFile.path);
- bool result;
+ bool? result;
result = await Navigator.push(
context,
PageTransition(
@@ -301,7 +303,7 @@ class _TakePictureState extends State
),
));
- if (result) Navigator.pop(context, image);
+ if (result!) Navigator.pop(context, image);
} else {
print('No image selected.');
}
@@ -309,7 +311,7 @@ class _TakePictureState extends State
}
Widget cameraWidget(context) {
- var camera = _controller.value;
+ var camera = _controller!.value;
final size = MediaQuery.of(context).size;
var scale = size.aspectRatio * camera.aspectRatio;
if (scale < 1) scale = 1 / scale;
@@ -318,7 +320,7 @@ class _TakePictureState extends State
scale: scale,
child: Center(
child: CameraPreview(
- _controller,
+ _controller!,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return GestureDetector(
diff --git a/lib/Pages/Sub_Pages/@Generic/Error.dart b/lib/Pages/Sub_Pages/@Generic/Error.dart
index b9c584e..7856482 100644
--- a/lib/Pages/Sub_Pages/@Generic/Error.dart
+++ b/lib/Pages/Sub_Pages/@Generic/Error.dart
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
class ErrorPage extends StatefulWidget {
- final String error;
+ final String? error;
- const ErrorPage({Key key, this.error}) : super(key: key);
+ const ErrorPage({Key? key, this.error}) : super(key: key);
@override
_ErrorPageState createState() => _ErrorPageState();
}
@@ -14,7 +14,7 @@ class _ErrorPageState extends State {
return Scaffold(
body: Center(
child: Text(
- widget.error,
+ widget.error!,
),
),
);
diff --git a/lib/Pages/Sub_Pages/@Generic/ProductImage.dart b/lib/Pages/Sub_Pages/@Generic/ProductImage.dart
index 12ed3f8..1fe1e66 100644
--- a/lib/Pages/Sub_Pages/@Generic/ProductImage.dart
+++ b/lib/Pages/Sub_Pages/@Generic/ProductImage.dart
@@ -8,7 +8,7 @@ class ProductImage extends StatefulWidget {
final productTag;
final productImageSRC;
const ProductImage(
- {Key key, @required this.productTag, @required this.productImageSRC})
+ {Key? key, required this.productTag, required this.productImageSRC})
: super(key: key);
@override
diff --git a/lib/Pages/Sub_Pages/@Generic/RedeemingCoupon.dart b/lib/Pages/Sub_Pages/@Generic/RedeemingCoupon.dart
index 964007b..d1e09a6 100644
--- a/lib/Pages/Sub_Pages/@Generic/RedeemingCoupon.dart
+++ b/lib/Pages/Sub_Pages/@Generic/RedeemingCoupon.dart
@@ -8,7 +8,7 @@ import 'package:teso/providers/user_provider.dart';
class RedeemingCoupon extends StatefulWidget {
final CouponDetails couponDetails;
- const RedeemingCoupon({Key key, @required this.couponDetails})
+ const RedeemingCoupon({Key? key, required this.couponDetails})
: super(key: key);
@override
_RedeemingCouponState createState() => _RedeemingCouponState();
diff --git a/lib/Pages/Sub_Pages/@Generic/SuccessRedeem.dart b/lib/Pages/Sub_Pages/@Generic/SuccessRedeem.dart
index 0546a47..e8fbc28 100644
--- a/lib/Pages/Sub_Pages/@Generic/SuccessRedeem.dart
+++ b/lib/Pages/Sub_Pages/@Generic/SuccessRedeem.dart
@@ -7,11 +7,11 @@ import 'package:teso/util/consts.dart';
class SuccessfullyRedeemed extends StatefulWidget {
final CouponDetails couponDetails;
- final int returns;
+ final int? returns;
const SuccessfullyRedeemed({
- Key key,
- @required this.couponDetails,
+ Key? key,
+ required this.couponDetails,
this.returns,
}) : super(key: key);
@override
@@ -67,7 +67,7 @@ class _SuccessfullyRedeemedState extends State {
child: CachedNetworkImage(
imageUrl: widget.couponDetails.targetProduct != null
? productURL +
- widget.couponDetails.targetProduct.productImage
+ widget.couponDetails.targetProduct!.productImage!
: "",
imageBuilder: (context, imageProvider) => Image(
width: MediaQuery.of(context).size.width * 0.28,
@@ -100,7 +100,7 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: widget.couponDetails.targetProduct.productID),
+ text: widget.couponDetails.targetProduct!.productID),
],
),
),
@@ -126,7 +126,7 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: widget.couponDetails.targetProduct.productName),
+ text: widget.couponDetails.targetProduct!.productName),
],
),
),
@@ -152,7 +152,7 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: widget.couponDetails.issuer.businessName),
+ text: widget.couponDetails.issuer!.businessName),
],
),
),
@@ -228,7 +228,7 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: (widget.couponDetails.productCost)
+ text: widget.couponDetails.productCost!
.toStringAsFixed(2)),
],
),
@@ -255,8 +255,8 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: ((widget.couponDetails.productCost *
- (widget.couponDetails.worth / 100)))
+ text: (widget.couponDetails.productCost! *
+ (widget.couponDetails.worth! / 100))
.toStringAsFixed(2),
style: new TextStyle(
color: Colors.green,
@@ -311,9 +311,9 @@ class _SuccessfullyRedeemedState extends State {
),
),
new TextSpan(
- text: (widget.couponDetails.productCost -
- (widget.couponDetails.productCost *
- (widget.couponDetails.worth / 100)))
+ text: (widget.couponDetails.productCost! -
+ (widget.couponDetails.productCost! *
+ (widget.couponDetails.worth! / 100)))
.toStringAsFixed(2),
style: new TextStyle(
color: Colors.red,
diff --git a/lib/Pages/Sub_Pages/@Generic/productDetails.dart b/lib/Pages/Sub_Pages/@Generic/productDetails.dart
index 02fd7a3..efb9e7f 100644
--- a/lib/Pages/Sub_Pages/@Generic/productDetails.dart
+++ b/lib/Pages/Sub_Pages/@Generic/productDetails.dart
@@ -14,9 +14,9 @@ import 'dart:convert';
import 'ProductImage.dart';
class ProductDetails extends StatefulWidget {
- final Product product;
+ final Product? product;
- const ProductDetails({Key key, this.product}) : super(key: key);
+ const ProductDetails({Key? key, this.product}) : super(key: key);
@override
_ProductDetailsState createState() => _ProductDetailsState();
}
@@ -25,25 +25,25 @@ enum AppBarBehavior { normal, pinned, floating, snapping }
class _ProductDetailsState extends State
with TickerProviderStateMixin {
- AnimationController _containerController;
- Animation width;
- Animation heigth;
+ late AnimationController _containerController;
+ late Animation width;
+ late Animation heigth;
double _appBarHeight = 256.0;
AppBarBehavior _appBarBehavior = AppBarBehavior.pinned;
- List coupons;
+ List? coupons;
int number = 0;
var _future;
- Future> getProductCoupons() async {
+ Future?> getProductCoupons() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
Map requestHeaders = {
'Content-type': 'application/json',
- 'Authorization': prefs.getString('tokensTeso')
+ 'Authorization': prefs.getString('tokensTeso')!
};
var register2 = serverLocation + 'coupons/productCoupon';
var client1 = await http.post(Uri.parse(register2),
- body: json.encode(widget.product.productID), headers: requestHeaders);
+ body: json.encode(widget.product!.productID), headers: requestHeaders);
if (client1.statusCode == 200) {
try {
@@ -51,7 +51,7 @@ class _ProductDetailsState extends State
coupons = List.from(
details.map((model) => CouponDetails.fromJSON(model)).toList());
setState(() {
- number = coupons.length;
+ number = coupons!.length;
});
return coupons;
} catch (e) {
@@ -163,9 +163,9 @@ class _ProductDetailsState extends State
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return ProductImage(
- productTag: widget.product.productID,
+ productTag: widget.product!.productID,
productImageSRC:
- widget.product.productImage,
+ widget.product!.productImage,
);
}));
},
@@ -173,10 +173,10 @@ class _ProductDetailsState extends State
width: width.value,
height: _appBarHeight,
child: Hero(
- tag: widget.product.productID,
+ tag: widget.product!.productID!,
child: CachedNetworkImage(
imageUrl: tesoProductThumbnail(
- productLogo: widget.product.productImage,
+ productLogo: widget.product!.productImage,
width: 640,
height: 640,
),
@@ -222,7 +222,7 @@ class _ProductDetailsState extends State
children: [
new Center(
child: new Text(
- widget.product.productName
+ widget.product!.productName!
.toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
@@ -249,7 +249,7 @@ class _ProductDetailsState extends State
padding:
const EdgeInsets.all(8.0),
child: new Text("GH¢ " +
- widget.product.unitPrice
+ widget.product!.unitPrice
.toString()),
)
],
@@ -297,10 +297,10 @@ class _ProductDetailsState extends State
new Padding(
padding:
const EdgeInsets.all(8.0),
- child: new Text(widget.product
+ child: new Text(widget.product!
.businessID !=
null
- ? widget.product.businessID
+ ? widget.product!.businessID!
.toUpperCase()
: ""),
)
@@ -320,8 +320,8 @@ class _ProductDetailsState extends State
),
),
new Text(
- widget.product.productDesc != null
- ? widget.product.productDesc
+ widget.product!.productDesc != null
+ ? widget.product!.productDesc!
: "",
style: TextStyle(
fontSize:
diff --git a/lib/Pages/Sub_Pages/@Generic/prominentDisclosure.dart b/lib/Pages/Sub_Pages/@Generic/prominentDisclosure.dart
index 9558af6..88f3b58 100644
--- a/lib/Pages/Sub_Pages/@Generic/prominentDisclosure.dart
+++ b/lib/Pages/Sub_Pages/@Generic/prominentDisclosure.dart
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:teso/util/SizeConfig.dart';
class ProminentDisclosure extends StatefulWidget {
- const ProminentDisclosure({Key key}) : super(key: key);
+ const ProminentDisclosure({Key? key}) : super(key: key);
@override
_ProminentDisclosureState createState() => _ProminentDisclosureState();
diff --git a/lib/Pages/Sub_Pages/@Generic/prominentDisclosureBackground.dart b/lib/Pages/Sub_Pages/@Generic/prominentDisclosureBackground.dart
index d4adbad..72f0302 100644
--- a/lib/Pages/Sub_Pages/@Generic/prominentDisclosureBackground.dart
+++ b/lib/Pages/Sub_Pages/@Generic/prominentDisclosureBackground.dart
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:teso/util/SizeConfig.dart';
class ProminentDisclosure extends StatefulWidget {
- const ProminentDisclosure({Key key}) : super(key: key);
+ const ProminentDisclosure({Key? key}) : super(key: key);
@override
_ProminentDisclosureState createState() => _ProminentDisclosureState();
diff --git a/lib/Pages/Sub_Pages/AccountSettings/BlockedUser.dart b/lib/Pages/Sub_Pages/AccountSettings/BlockedUser.dart
index c2a31e3..0282ae3 100644
--- a/lib/Pages/Sub_Pages/AccountSettings/BlockedUser.dart
+++ b/lib/Pages/Sub_Pages/AccountSettings/BlockedUser.dart
@@ -9,7 +9,7 @@ import 'package:teso/util/SizeConfig.dart';
import 'package:teso/util/consts.dart';
class BlockAccounts extends StatefulWidget {
- const BlockAccounts({Key key}) : super(key: key);
+ const BlockAccounts({Key? key}) : super(key: key);
@override
_BlockAccountsState createState() => _BlockAccountsState();
@@ -51,7 +51,7 @@ class _BlockAccountsState extends State {
),
body: Consumer(
builder: (context, value, child) {
- if (value.blockUserList == null) {
+ if (value.blockUserList.isEmpty) {
return Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(
diff --git a/lib/Pages/Sub_Pages/AccountSettings/changePassword.dart b/lib/Pages/Sub_Pages/AccountSettings/changePassword.dart
index 7d21c94..d378a9e 100644
--- a/lib/Pages/Sub_Pages/AccountSettings/changePassword.dart
+++ b/lib/Pages/Sub_Pages/AccountSettings/changePassword.dart
@@ -29,7 +29,7 @@ class _ChangePasswordState extends State {
Map requestHeaders = {
'Content-type': 'application/json',
- 'Authorization': prefs.getString('tokensTeso')
+ 'Authorization': prefs.getString('tokensTeso')!
};
var register2 = serverLocation + 'users/verifypassword';
diff --git a/lib/Pages/Sub_Pages/AccountSettings/genderPicker.dart b/lib/Pages/Sub_Pages/AccountSettings/genderPicker.dart
index b643ac7..aae20da 100644
--- a/lib/Pages/Sub_Pages/AccountSettings/genderPicker.dart
+++ b/lib/Pages/Sub_Pages/AccountSettings/genderPicker.dart
@@ -5,15 +5,15 @@ import 'package:teso/providers/user_provider.dart';
import 'package:provider/provider.dart';
class Gender extends StatefulWidget {
- final int value;
+ final int? value;
- const Gender({Key key, this.value}) : super(key: key);
+ const Gender({Key? key, this.value}) : super(key: key);
@override
_GenderState createState() => _GenderState(value: this.value);
}
class _GenderState extends State {
- int value;
+ int? value;
_GenderState({this.value});
List genders = ["Male", "Female", "Other"];
bool light = true;
@@ -54,8 +54,8 @@ class _GenderState extends State {
),
onPressed: () {
Provider.of(context, listen: false)
- .currentUser
- .gender = genders[value];
+ .currentUser!
+ .gender = genders[value!];
Navigator.of(context).pop(value);
},
child: Text("Done"),
@@ -73,7 +73,7 @@ class _GenderState extends State {
ListTile(
title: Text(
genders[i],
- style: Theme.of(context).textTheme.subtitle1.copyWith(
+ style: Theme.of(context).textTheme.subtitle1!.copyWith(
color: light
? i == 3
? Colors.black38
@@ -89,7 +89,7 @@ class _GenderState extends State {
activeColor: accentMain,
onChanged: i == 3
? null
- : (int _value) {
+ : (int? _value) {
setState(() {
value = _value;
});
diff --git a/lib/Pages/Sub_Pages/AccountSettings/newPassword.dart b/lib/Pages/Sub_Pages/AccountSettings/newPassword.dart
index 4951d6f..fa6a24c 100644
--- a/lib/Pages/Sub_Pages/AccountSettings/newPassword.dart
+++ b/lib/Pages/Sub_Pages/AccountSettings/newPassword.dart
@@ -16,8 +16,8 @@ class CreateNewPassword extends StatefulWidget {
class _CreateNewPasswordState extends State
with TickerProviderStateMixin {
TextEditingController password = new TextEditingController();
- AnimationController _controller;
- Animation _fabScale;
+ late AnimationController _controller;
+ late Animation _fabScale;
bool eightChars = false;
bool specialChar = false;
bool upperCaseChar = false;
@@ -38,7 +38,7 @@ class _CreateNewPasswordState extends State
Map requestHeaders = {
'Content-type': 'application/json',
- 'Authorization': prefs.getString('tokensTeso')
+ 'Authorization': prefs.getString('tokensTeso')!
};
var register2 = serverLocation + 'users/changepassword';
@@ -220,7 +220,7 @@ class _CreateNewPasswordState extends State
),
boxShadow: [
BoxShadow(
- color: Colors.grey[500],
+ color: Colors.grey[500]!,
offset: Offset(0.0, 1.5),
blurRadius: 1.5,
),
diff --git a/lib/Pages/Sub_Pages/Business/BusinessProducts.dart b/lib/Pages/Sub_Pages/Business/BusinessProducts.dart
index 7aee8ad..091700e 100644
--- a/lib/Pages/Sub_Pages/Business/BusinessProducts.dart
+++ b/lib/Pages/Sub_Pages/Business/BusinessProducts.dart
@@ -5,9 +5,9 @@ import 'package:teso/Classes/API Clasess/Product.dart';
import 'package:teso/Pages/PageWidgets/BusinessProfile/BusinessItems.dart';
class BusinessProducts extends StatefulWidget {
- final String shopName;
- final List product;
- const BusinessProducts({Key key, this.shopName, this.product})
+ final String? shopName;
+ final List? product;
+ const BusinessProducts({Key? key, this.shopName, this.product})
: super(key: key);
@override
@@ -16,13 +16,13 @@ class BusinessProducts extends StatefulWidget {
}
class _BusinessProductsState extends State {
- final String shopName;
- ScrollController _controller;
- SharedPreferences prefs;
- final List product;
+ final String? shopName;
+ late ScrollController _controller;
+ SharedPreferences? prefs;
+ final List? product;
List show = [];
_BusinessProductsState({this.shopName, this.product});
- int count;
+ int count = 0;
void _scrollListener() {
if (_controller.offset >= _controller.position.maxScrollExtent &&
!_controller.position.outOfRange) {
@@ -35,7 +35,7 @@ class _BusinessProductsState extends State {
count = show.length;
for (int i = 1; i <= 5; i++) {
setState(() {
- show.add(product.elementAt(count));
+ show.add(product!.elementAt(count));
count++;
imageCache.clear();
});
diff --git a/lib/Pages/Sub_Pages/Business/BusinessProfile.dart b/lib/Pages/Sub_Pages/Business/BusinessProfile.dart
index 68dd4e9..2df07c8 100644
--- a/lib/Pages/Sub_Pages/Business/BusinessProfile.dart
+++ b/lib/Pages/Sub_Pages/Business/BusinessProfile.dart
@@ -14,8 +14,8 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart';
class BusinessProfile extends StatefulWidget {
- final TesoShop shop;
- const BusinessProfile({Key key, this.shop}) : super(key: key);
+ final TesoShop? shop;
+ const BusinessProfile({Key? key, this.shop}) : super(key: key);
@override
_BusinessProfileState createState() => new _BusinessProfileState(shop: shop);
}
@@ -24,27 +24,27 @@ enum AppBarBehavior { normal, pinned, floating, snapping }
class _BusinessProfileState extends State
with TickerProviderStateMixin {
- AnimationController _containerController;
- Animation width;
- Animation heigth;
- final TesoShop shop;
+ late AnimationController _containerController;
+ Animation? width;
+ late Animation heigth;
+ final TesoShop? shop;
_BusinessProfileState({this.shop});
- bool subscribed = false;
- SharedPreferences prefs;
+ bool? subscribed = false;
+ late SharedPreferences prefs;
var stats;
int productTotal = 0;
int adsTotal = 0;
int couponsTotal = 0;
- List products;
- List coupons;
- BusinessProfileClass profile;
- List subscribers;
+ List? products;
+ List? coupons;
+ late BusinessProfileClass profile;
+ List? subscribers;
- List _randomChildren;
+ List? _randomChildren;
Future subscribe() async {
prefs = await SharedPreferences.getInstance();
- String token = prefs.getString("tokensTeso");
+ String token = prefs.getString("tokensTeso")!;
Map requestHeaders = {
'Content-type': 'application/json',
'Authorization': token
@@ -52,7 +52,7 @@ class _BusinessProfileState extends State
var register = serverLocation + 'relationships/business-subscription';
var client = await http.post(Uri.parse(register),
- headers: requestHeaders, body: json.encode(shop.shopID));
+ headers: requestHeaders, body: json.encode(shop!.shopID));
if (client.statusCode == 200) {
setState(() {
subscribed = true;
@@ -64,7 +64,7 @@ class _BusinessProfileState extends State
Future unsubscribe() async {
prefs = await SharedPreferences.getInstance();
- String token = prefs.getString("tokensTeso");
+ String token = prefs.getString("tokensTeso")!;
Map requestHeaders = {
'Content-type': 'application/json',
'Authorization': token
@@ -72,7 +72,7 @@ class _BusinessProfileState extends State
var register = serverLocation + 'relationships/business-unsubscribe';
var client = await http.post(Uri.parse(register),
- headers: requestHeaders, body: json.encode(shop.shopID));
+ headers: requestHeaders, body: json.encode(shop!.shopID));
if (client.statusCode == 200) {
setState(() {
subscribed = false;
@@ -84,7 +84,7 @@ class _BusinessProfileState extends State
fetchProfile() async {
prefs = await SharedPreferences.getInstance();
- String token = prefs.getString("tokensTeso");
+ String token = prefs.getString("tokensTeso")!;
Map requestHeaders = {
'Content-type': 'application/json',
'Authorization': token
@@ -92,17 +92,17 @@ class _BusinessProfileState extends State