diff --git a/App Store Icons/android/drawable/ic_launcher_background.xml b/App Store Icons/android/drawable/ic_launcher_background.xml new file mode 100755 index 00000000..ca3826a4 --- /dev/null +++ b/App Store Icons/android/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App Store Icons/android/mipmap-anydpi-v26/ic_launcher.xml b/App Store Icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100755 index 00000000..d372a4fc --- /dev/null +++ b/App Store Icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/App Store Icons/android/mipmap-anydpi-v26/ic_launcher_round.xml b/App Store Icons/android/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100755 index 00000000..d372a4fc --- /dev/null +++ b/App Store Icons/android/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/App Store Icons/android/mipmap-hdpi/ic_launcher.png b/App Store Icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..dfc4307a Binary files /dev/null and b/App Store Icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/App Store Icons/android/mipmap-hdpi/ic_launcher_foreground.png b/App Store Icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..61cb21c7 Binary files /dev/null and b/App Store Icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/App Store Icons/android/mipmap-hdpi/ic_launcher_round.png b/App Store Icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..fb945cbd Binary files /dev/null and b/App Store Icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/App Store Icons/android/mipmap-mdpi/ic_launcher.png b/App Store Icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..16b99780 Binary files /dev/null and b/App Store Icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/App Store Icons/android/mipmap-mdpi/ic_launcher_foreground.png b/App Store Icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..5c8fb3ec Binary files /dev/null and b/App Store Icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/App Store Icons/android/mipmap-mdpi/ic_launcher_round.png b/App Store Icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..c470c59a Binary files /dev/null and b/App Store Icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/App Store Icons/android/mipmap-xhdpi/ic_launcher.png b/App Store Icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..e68eb987 Binary files /dev/null and b/App Store Icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/App Store Icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/App Store Icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..61a5aea3 Binary files /dev/null and b/App Store Icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/App Store Icons/android/mipmap-xhdpi/ic_launcher_round.png b/App Store Icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..850c1f58 Binary files /dev/null and b/App Store Icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/App Store Icons/android/mipmap-xxhdpi/ic_launcher.png b/App Store Icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..4070ce10 Binary files /dev/null and b/App Store Icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/App Store Icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/App Store Icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..9ba7cf5d Binary files /dev/null and b/App Store Icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/App Store Icons/android/mipmap-xxhdpi/ic_launcher_round.png b/App Store Icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..53ac4eb5 Binary files /dev/null and b/App Store Icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/App Store Icons/android/mipmap-xxxhdpi/ic_launcher.png b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..8f0fb09e Binary files /dev/null and b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..86639b6a Binary files /dev/null and b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..49711484 Binary files /dev/null and b/App Store Icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/App Store Icons/android/playstore-icon copy.png b/App Store Icons/android/playstore-icon copy.png new file mode 100644 index 00000000..b6d890ef Binary files /dev/null and b/App Store Icons/android/playstore-icon copy.png differ diff --git a/App Store Icons/android/playstore-icon.png b/App Store Icons/android/playstore-icon.png new file mode 100644 index 00000000..40797293 Binary files /dev/null and b/App Store Icons/android/playstore-icon.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Contents.json b/App Store Icons/ios/AppIcon.appiconset/Contents.json new file mode 100755 index 00000000..5c8064e1 --- /dev/null +++ b/App Store Icons/ios/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images": [ + { + "idiom": "iphone", + "size": "20x20", + "scale": "2x", + "filename": "Icon-App-20x20@2x.png" + }, + { + "idiom": "iphone", + "size": "20x20", + "scale": "3x", + "filename": "Icon-App-20x20@3x.png" + }, + { + "idiom": "iphone", + "size": "29x29", + "scale": "1x", + "filename": "Icon-App-29x29@1x.png" + }, + { + "idiom": "iphone", + "size": "29x29", + "scale": "2x", + "filename": "Icon-App-29x29@2x.png" + }, + { + "idiom": "iphone", + "size": "29x29", + "scale": "3x", + "filename": "Icon-App-29x29@3x.png" + }, + { + "idiom": "iphone", + "size": "40x40", + "scale": "2x", + "filename": "Icon-App-40x40@2x.png" + }, + { + "idiom": "iphone", + "size": "40x40", + "scale": "3x", + "filename": "Icon-App-40x40@3x.png" + }, + { + "idiom": "iphone", + "size": "60x60", + "scale": "2x", + "filename": "Icon-App-60x60@2x.png" + }, + { + "idiom": "iphone", + "size": "60x60", + "scale": "3x", + "filename": "Icon-App-60x60@3x.png" + }, + { + "idiom": "ipad", + "size": "20x20", + "scale": "1x", + "filename": "Icon-App-20x20@1x.png" + }, + { + "idiom": "ipad", + "size": "20x20", + "scale": "2x", + "filename": "Icon-App-20x20@2x.png" + }, + { + "idiom": "ipad", + "size": "29x29", + "scale": "1x", + "filename": "Icon-App-29x29@1x.png" + }, + { + "idiom": "ipad", + "size": "29x29", + "scale": "2x", + "filename": "Icon-App-29x29@2x.png" + }, + { + "idiom": "ipad", + "size": "40x40", + "scale": "1x", + "filename": "Icon-App-40x40@1x.png" + }, + { + "idiom": "ipad", + "size": "40x40", + "scale": "2x", + "filename": "Icon-App-40x40@2x.png" + }, + { + "idiom": "ipad", + "size": "76x76", + "scale": "1x", + "filename": "Icon-App-76x76@1x.png" + }, + { + "idiom": "ipad", + "size": "76x76", + "scale": "2x", + "filename": "Icon-App-76x76@2x.png" + }, + { + "idiom": "ipad", + "size": "83.5x83.5", + "scale": "2x", + "filename": "Icon-App-83.5x83.5@2x.png" + }, + { + "size": "1024x1024", + "idiom": "ios-marketing", + "scale": "1x", + "filename": "ItunesArtwork@2x.png" + } + ], + "info": { + "version": 1, + "author": "makeappicon" + } +} diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@1x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..70592c0f Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..6ed950dc Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@3x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..0c2ac3ed Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@1x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..35d63116 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..f1dd6085 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@3x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..3c9fc024 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@1x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..6ed950dc Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..ac72635a Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@3x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..883ffdb9 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..883ffdb9 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@3x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..28baeae8 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@1x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..a74333b2 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..96f4bdf5 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/App Store Icons/ios/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..67d14e15 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/App Store Icons/ios/AppIcon.appiconset/ItunesArtwork@2x.png b/App Store Icons/ios/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 00000000..d14e9845 Binary files /dev/null and b/App Store Icons/ios/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/App Store Icons/ios/iTunesArtwork@1x.png b/App Store Icons/ios/iTunesArtwork@1x.png new file mode 100644 index 00000000..6fc19b0f Binary files /dev/null and b/App Store Icons/ios/iTunesArtwork@1x.png differ diff --git a/App Store Icons/ios/iTunesArtwork@2x.png b/App Store Icons/ios/iTunesArtwork@2x.png new file mode 100644 index 00000000..d14e9845 Binary files /dev/null and b/App Store Icons/ios/iTunesArtwork@2x.png differ diff --git a/App Store Icons/ios/iTunesArtwork@3x.png b/App Store Icons/ios/iTunesArtwork@3x.png new file mode 100644 index 00000000..934e2020 Binary files /dev/null and b/App Store Icons/ios/iTunesArtwork@3x.png differ diff --git a/Certs/APNSDevPushCert.p12 b/Certs/APNSDevPushCert.p12 deleted file mode 100644 index dba27aec..00000000 Binary files a/Certs/APNSDevPushCert.p12 and /dev/null differ diff --git a/Certs/APNSProdCert.certSigningRequest b/Certs/APNSProdCert.certSigningRequest deleted file mode 100644 index 3f13a387..00000000 --- a/Certs/APNSProdCert.certSigningRequest +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j -b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBALcPrk09MmhQhRNe8LYdaeN4mYtoKJg3 -SndMLgpxnaRqP7a6f4sp118wCFZsTXnwhPVP4DzmXWc2AzZtsusmhdw1tzNFtme0 -PtEjDXIPI2lHU3Zhi2zukZdAVxF+uNi3pcp0axina60ZQciIfb/7Fx6hNbqpk90E -O8a2Ob17Wq/ZTYIP4H7ZGydUe2ra9QyDtjmGj9vpEv+xXYWX685sgEylTG14DSOP -ozGsQmaf+QCMbCT3osq7idWc1IQ+3Oed0kUTx1jmRtZwPzQkJJ1Bx3vYSXN/EOlb -u+ei1Nqtc14aVCYvmcuvGDtMyRtw6w+syCw2CpJCPGNkxNz+EH9h+EUCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQBYdu2AaZY6kReuT1Xp8ktlyPfjBRKhPPChuaeR -tFnYMsJtG0aIA/xOu4/RYDgmL92seimULXd9DIPvkJ2DuaB+bdfGTw0qXUlihkm8 -ui5O0L2F9OZbQxJogvTmrMsKnkoR27O5vyfCn9VMOLk3x1nyEzAXIj/5GHWw9T6t -r65jPUOfm6ikiZtICBzSaTPBtyfZB8mrbwG2dpOvVNSa1dj3xip4L8CL6TxH+qM3 -+N90QFYjvjphJkpn2Kt0ow9IyIyeqJbIYJmsWoV9pXddOHCjKdTWUjq7D2Jn3eUA -DAKjKgVqF4/dU10k7EtSfrw01aHLXjj5FxsD5YhVrgTA5xSq ------END CERTIFICATE REQUEST----- diff --git a/Certs/APNSProdCert.p12 b/Certs/APNSProdCert.p12 deleted file mode 100644 index b0ada453..00000000 Binary files a/Certs/APNSProdCert.p12 and /dev/null differ diff --git a/Certs/ApplePushCert.p12 b/Certs/ApplePushCert.p12 deleted file mode 100644 index 3a1d15c8..00000000 Binary files a/Certs/ApplePushCert.p12 and /dev/null differ diff --git a/Certs/ApplePushServices.certSigningRequest b/Certs/ApplePushServices.certSigningRequest deleted file mode 100644 index 7d509a0a..00000000 --- a/Certs/ApplePushServices.certSigningRequest +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j -b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q -1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU -69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA -l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl -T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq -Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk -1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF -rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l -LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP -xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh -qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY ------END CERTIFICATE REQUEST----- diff --git a/Certs/ApplePushServicesSandbox.certSigningRequest b/Certs/ApplePushServicesSandbox.certSigningRequest deleted file mode 100644 index 7d509a0a..00000000 --- a/Certs/ApplePushServicesSandbox.certSigningRequest +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j -b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q -1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU -69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA -l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl -T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq -Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk -1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF -rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l -LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP -xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh -qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY ------END CERTIFICATE REQUEST----- diff --git a/Certs/GoogleService-Info.plist b/Certs/GoogleService-Info.plist new file mode 100644 index 00000000..b410994e --- /dev/null +++ b/Certs/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyCRDdv-9_QSpBM2SokbO5zxQsLDsy-z10s + GCM_SENDER_ID + 218653915217 + PLIST_VERSION + 1 + BUNDLE_ID + sa.edu.kku.kkuMcApp + PROJECT_ID + kkumc-e0903 + STORAGE_BUCKET + kkumc-e0903.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:218653915217:ios:de051163e0381558896070 + + \ No newline at end of file diff --git a/Certs/Pass.rtf b/Certs/Pass.rtf deleted file mode 100644 index 2fe18706..00000000 --- a/Certs/Pass.rtf +++ /dev/null @@ -1,8 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2513 -\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -{\*\expandedcolortbl;;} -\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 -\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 - -\f0\fs24 \cf0 Hmg54321} \ No newline at end of file diff --git a/Certs/VOIP Certs/HMGVoIPCSR.certSigningRequest b/Certs/VOIP Certs/HMGVoIPCSR.certSigningRequest deleted file mode 100644 index 15f18c68..00000000 --- a/Certs/VOIP Certs/HMGVoIPCSR.certSigningRequest +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICgjCCAWoCAQAwPTEjMCEGCSqGSIb3DQEJARYUSGFyb29uNjEzOEBnbWFpbC5j -b20xCTAHBgNVBAMMADELMAkGA1UEBhMCQUUwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDHadAER62mSf+wOxPu9rF1EvifDxbAEv6znZIHvwimgShdPLLS -rkFdN4VpSHMzrASqpHnlSL3wxO6eym9pATH3WfLvKIQxnn9OkO5fScjQi0RkFbe0 -JqTqN2LaFxrSFrhqQ/1p/izr690HqjrfquRI8t8evatyTku67/xcCj6uSIVLfJoS -8YCDVn0Y+w9n2Vw/+kHiNY6P96qp/CfXZgMLFpUu0mqcmZl97htfmB9AH2tC45yh -mKxDJiKEnk69zVCh/bkc9tFE1tUDkkKblJTCEyWfdDUUYM4ET3t3fBqWB78F4J3m -XglByGZmHgY2+7nsSQBiq7k9tFN2c7FZ9BD3AgMBAAGgADANBgkqhkiG9w0BAQsF -AAOCAQEAJxqoyfEJ7V83ffCAqkYNNEcCQMIRi1Y4cTTm/5KZGA/UPeDeX48/bm4K -XIf2zbv88OGASInBrvMDp0x0zs13Dx2yXxofGN+iQSBwN6jPV/upmm0DjgTmgUGh -BJste70LaU228ADzWDw8UJm/GKjK8WvE0XOGpPKYq9cuVW3M+6QRoRHXy0eJc2PX -VgopsuhHUyA5trxM7k4yc6GgYVx+fAwMaplovTwn5U8XK6bDEIvCjImfat/u4Wp8 -R31p0BQzQaeyWfpp9Ucn/fvQSeB+wtjhHuA1ukcyWY1kBYOyCMIHymFrJLaTpUj7 -aQFYZDV28HYv0yWhWIAD9Pu+aDHWpA== ------END CERTIFICATE REQUEST----- diff --git a/Certs/VOIP Certs/VOIP.pem b/Certs/VOIP Certs/VOIP.pem deleted file mode 100644 index 029e2a7a..00000000 --- a/Certs/VOIP Certs/VOIP.pem +++ /dev/null @@ -1,74 +0,0 @@ -Bag Attributes - friendlyName: VoIP Services: com.HMG.HMG-Smartphone - localKeyID: 70 4A 99 03 F8 D7 92 FA F7 2F DD 3B D8 BF 2C F0 BD CE 21 C8 -subject=/UID=com.HMG.HMG-Smartphone.voip/CN=VoIP Services: com.HMG.HMG-Smartphone/OU=3A359E86ZF/O=Dr Sulaiman Al Habib Medical Center/C=SA -issuer=/CN=Apple Worldwide Developer Relations Certification Authority/OU=G4/O=Apple Inc./C=US ------BEGIN CERTIFICATE----- -MIIGkTCCBXmgAwIBAgIQFB+/PYFlrZ6SCzSX9cqOBDANBgkqhkiG9w0BAQsFADB1 -MUQwQgYDVQQDDDtBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9ucyBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTELMAkGA1UECwwCRzQxEzARBgNVBAoMCkFw -cGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTI0MDYwOTEyMDc1MVoXDTI1MDcwOTEy -MDc1MFowga0xKzApBgoJkiaJk/IsZAEBDBtjb20uSE1HLkhNRy1TbWFydHBob25l -LnZvaXAxLjAsBgNVBAMMJVZvSVAgU2VydmljZXM6IGNvbS5ITUcuSE1HLVNtYXJ0 -cGhvbmUxEzARBgNVBAsMCjNBMzU5RTg2WkYxLDAqBgNVBAoMI0RyIFN1bGFpbWFu -IEFsIEhhYmliIE1lZGljYWwgQ2VudGVyMQswCQYDVQQGEwJTQTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMdp0ARHraZJ/7A7E+72sXUS+J8PFsAS/rOd -kge/CKaBKF08stKuQV03hWlIczOsBKqkeeVIvfDE7p7Kb2kBMfdZ8u8ohDGef06Q -7l9JyNCLRGQVt7QmpOo3YtoXGtIWuGpD/Wn+LOvr3QeqOt+q5Ejy3x69q3JOS7rv -/FwKPq5IhUt8mhLxgINWfRj7D2fZXD/6QeI1jo/3qqn8J9dmAwsWlS7SapyZmX3u -G1+YH0Afa0LjnKGYrEMmIoSeTr3NUKH9uRz20UTW1QOSQpuUlMITJZ90NRRgzgRP -e3d8GpYHvwXgneZeCUHIZmYeBjb7uexJAGKruT20U3ZzsVn0EPcCAwEAAaOCAuIw -ggLeMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUW9n6HeeaGgujmXYiUIY+kchb -d6gwcAYIKwYBBQUHAQEEZDBiMC0GCCsGAQUFBzAChiFodHRwOi8vY2VydHMuYXBw -bGUuY29tL3d3ZHJnNC5kZXIwMQYIKwYBBQUHMAGGJWh0dHA6Ly9vY3NwLmFwcGxl -LmNvbS9vY3NwMDMtd3dkcmc0MDUwggEeBgNVHSAEggEVMIIBETCCAQ0GCSqGSIb3 -Y2QFATCB/zCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRp -ZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRo -ZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1 -c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGlj -ZSBzdGF0ZW1lbnRzLjA3BggrBgEFBQcCARYraHR0cHM6Ly93d3cuYXBwbGUuY29t -L2NlcnRpZmljYXRlYXV0aG9yaXR5LzATBgNVHSUEDDAKBggrBgEFBQcDAjAyBgNV -HR8EKzApMCegJaAjhiFodHRwOi8vY3JsLmFwcGxlLmNvbS93d2RyZzQtNi5jcmww -HQYDVR0OBBYEFHBKmQP415L69y/dO9i/LPC9ziHIMA4GA1UdDwEB/wQEAwIHgDAQ -BgoqhkiG92NkBgMBBAIFADAQBgoqhkiG92NkBgMCBAIFADBDBgoqhkiG92NkBgME -BDUMM2NvbS5ITUcuSE1HLVNtYXJ0cGhvbmUsIGNvbS5ITUcuSE1HLVNtYXJ0cGhv -bmUudm9pcDAQBgoqhkiG92NkBgMFBAIFADAmBgoqhkiG92NkBgMDBBgMFmNvbS5I -TUcuSE1HLVNtYXJ0cGhvbmUwDQYJKoZIhvcNAQELBQADggEBAJAcIzSskk8/GbxQ -7nGUPPEWFswL66xTt3GusHmeXkKDXG3ac+4jLk8yU7gunos77CNDm+9TkShdJ2Rg -tTRopK4ockqwoPrCeEVrooHR4e42YvmkB6AfYKJRnQZQVJIpW0OES7vrtoWVGoNj -ktHOV+wFIuAQPI9P4z0RFyRw85MHr+jFqxeLU/1500PwCxIiNHkIcUtzZgrnr22R -7rgkxav+RrjLjXVQvC4VJispKCU7yR69Xv1rsC5zc7OTCuCkbQ9FvnfsiUz5ZDzp -3D0gGojU9wmJ1yVk9HiZsuiVwmg/LbDHI3pSYbxz3n1UHB6Pu0jX3c3Uxkx674HD -/0uvHzg= ------END CERTIFICATE----- -Bag Attributes - localKeyID: 70 4A 99 03 F8 D7 92 FA F7 2F DD 3B D8 BF 2C F0 BD CE 21 C8 -Key Attributes: ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHadAER62mSf+w -OxPu9rF1EvifDxbAEv6znZIHvwimgShdPLLSrkFdN4VpSHMzrASqpHnlSL3wxO6e -ym9pATH3WfLvKIQxnn9OkO5fScjQi0RkFbe0JqTqN2LaFxrSFrhqQ/1p/izr690H -qjrfquRI8t8evatyTku67/xcCj6uSIVLfJoS8YCDVn0Y+w9n2Vw/+kHiNY6P96qp -/CfXZgMLFpUu0mqcmZl97htfmB9AH2tC45yhmKxDJiKEnk69zVCh/bkc9tFE1tUD -kkKblJTCEyWfdDUUYM4ET3t3fBqWB78F4J3mXglByGZmHgY2+7nsSQBiq7k9tFN2 -c7FZ9BD3AgMBAAECggEBALTXH58SBcd86hS+rsgSDkJ2ruNIQsBzOWpYJjtCIi0l -ih5r0lu/TWWk2SbuXhLpF95MhILLIf18Ck4UlU5rmA2SE/6RBrkc3KS6SII/no6J -Db+Z9lu4g+wnyEyxkVAe7KTp/aGmsMROxMaTuQpnptkE8BSnuxhRKtpfksNBQzC2 -19OkEy4JAO7xWbm9w/ASiCtYf0Vj26DQo982Fe44cpG08iB2v1uUJINQkGzmg+85 -vvn5A1ECpSpgd/eOa68ojxeNSU7iFGZPbpjuincLPBFlC5zp9KD1Bt6p2KwIizBl -GPYTp6a1DnWly6n0PuLN0fl/nRmI6ar48Ja1Qzk8NvECgYEA5iQo9lnjNOHjT6bk -hj5QXMz3MDMCPdJo6jQyADtmsC/F4RjufujfXPhMv2v8JLAjQjNMgfhTSF68zYHf -i1qW8e/CgWu7mGQEIhWtxiTkLou8zW3VjxwpgfeUsGI5L+PxoN53ZUVcetLz4Y58 -8ATEhlxh02uGmG2k3HbvFu9NBT8CgYEA3dHJfFX2xv53ZD1E2IE1rM3j7a32s7VB -k/YX8ODrAJxwNmy/vm4gd5h6ofqVS1/IV4NHFbmQ5c1tzB44YGOEZH5Ta9hhHgHU -xoa3q6t+kjR9KrQvxjTSe9mW5x/jAgU0Wp/XrAfMZxc2eukb4/sJAGKG0kyFeX5O -5abVixWj7kkCgYAafd8ZPI+i7r2z1YpIybOGezGZIsYHR8k77HY1AKF5doZYuv35 -LeVIVmy/PDbyIjRs0mrkKymrEvy4y1JoQC1P/EFvlG8rw5eWNNikDmsV0JATNal3 -p84/X7iF9UiP8rVFx1YHGkzi9pWMSVKobmQQ82FvbNk5gqWPm0E6aqF7EQKBgQDB -mE0PlT9SIdk1xTuG8g5UiUV6tS/xXCql5kyy0LqJx/8voO4gV6FCf/PX1wnhxPDn -YA30agaKaiZ/1YhCp9hulMpd/3WTaOm5cu5uh7hqBiGP2b8wb/2cViWcBnpr0vsE -dSkYXZ4KA3pq/3R2HyyWB2e/t0Vu6cwWJuuM/hAa8QKBgGNRStNVSMPvzx2X7mB6 -EqdlWqVbfSTHJiZKyNPWHlSuZgdQ14BRwq7KZ0ysZy+kOX4rh1rIfqzrKc62xEXB -E+fmIpu+DUOM5ojEPCf9Om87r3fMJ54SjM7z1dtVc+Muy4TnFZ4UQcN9txWbnkAo -++H5gC9DBedOEXkwoCYjoeuM ------END PRIVATE KEY----- diff --git a/Certs/VOIP Certs/p12 pass.pdf b/Certs/VOIP Certs/p12 pass.pdf deleted file mode 100644 index d38d0f4e..00000000 Binary files a/Certs/VOIP Certs/p12 pass.pdf and /dev/null differ diff --git a/Certs/VOIP Certs/voip_services.cer b/Certs/VOIP Certs/voip_services.cer deleted file mode 100644 index a4c7342b..00000000 Binary files a/Certs/VOIP Certs/voip_services.cer and /dev/null differ diff --git a/Certs/aps.cer b/Certs/aps.cer deleted file mode 100644 index d95bac40..00000000 Binary files a/Certs/aps.cer and /dev/null differ diff --git a/Certs/aps_development.cer b/Certs/aps_development.cer deleted file mode 100644 index 9a9934bb..00000000 Binary files a/Certs/aps_development.cer and /dev/null differ diff --git a/Certs/google-services.json b/Certs/google-services.json new file mode 100644 index 00000000..a11b41a2 --- /dev/null +++ b/Certs/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "218653915217", + "project_id": "kkumc-e0903", + "storage_bucket": "kkumc-e0903.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:218653915217:android:28ffffcec5fbf67c896070", + "android_client_info": { + "package_name": "sa.edu.kku.kkuMcApp" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCcN2iDIOH8X7yOikH95cZqyMqA9Kgc8P0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Google Play Signing Certs/deployment_cert.der b/Google Play Signing Certs/deployment_cert.der deleted file mode 100644 index 46c10c23..00000000 Binary files a/Google Play Signing Certs/deployment_cert.der and /dev/null differ diff --git a/Google Play Signing Certs/upload_cert.der b/Google Play Signing Certs/upload_cert.der deleted file mode 100644 index 46c10c23..00000000 Binary files a/Google Play Signing Certs/upload_cert.der and /dev/null differ diff --git a/GoogleService-Info.plist b/GoogleService-Info.plist new file mode 100644 index 00000000..b410994e --- /dev/null +++ b/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyCRDdv-9_QSpBM2SokbO5zxQsLDsy-z10s + GCM_SENDER_ID + 218653915217 + PLIST_VERSION + 1 + BUNDLE_ID + sa.edu.kku.kkuMcApp + PROJECT_ID + kkumc-e0903 + STORAGE_BUCKET + kkumc-e0903.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:218653915217:ios:de051163e0381558896070 + + \ No newline at end of file diff --git a/GoogleService-Info_DQ.plist b/GoogleService-Info_DQ.plist deleted file mode 100644 index 0c093a2a..00000000 --- a/GoogleService-Info_DQ.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r - API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs - GCM_SENDER_ID - 864393916058 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloud.diplomaticquarterapp - PROJECT_ID - diplomaticquarter-d2385 - STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 - DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com - - \ No newline at end of file diff --git a/GoogleService-Info_HMG.plist b/GoogleService-Info_HMG.plist deleted file mode 100644 index 153aa2c6..00000000 --- a/GoogleService-Info_HMG.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CLIENT_ID - 815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt - ANDROID_CLIENT_ID - 815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com - API_KEY - AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA - GCM_SENDER_ID - 815750722565 - PLIST_VERSION - 1 - BUNDLE_ID - com.HMG.Smartphone - PROJECT_ID - api-project-815750722565 - STORAGE_BUCKET - api-project-815750722565.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:815750722565:ios:328ec247a81a2ca23c186c - DATABASE_URL - https://api-project-815750722565.firebaseio.com - - \ No newline at end of file diff --git a/KKUH Screenshots.zip b/KKUH Screenshots.zip new file mode 100644 index 00000000..acb59246 Binary files /dev/null and b/KKUH Screenshots.zip differ diff --git a/KKUH Screenshots/Homepage 2.jpg b/KKUH Screenshots/Homepage 2.jpg new file mode 100755 index 00000000..8c7dfd7e Binary files /dev/null and b/KKUH Screenshots/Homepage 2.jpg differ diff --git a/KKUH Screenshots/Homepage.jpg b/KKUH Screenshots/Homepage.jpg new file mode 100755 index 00000000..1368bb15 Binary files /dev/null and b/KKUH Screenshots/Homepage.jpg differ diff --git a/KKUH Screenshots/Login.jpg b/KKUH Screenshots/Login.jpg new file mode 100755 index 00000000..0febdcae Binary files /dev/null and b/KKUH Screenshots/Login.jpg differ diff --git a/KKUH Screenshots/Medical File.jpg b/KKUH Screenshots/Medical File.jpg new file mode 100755 index 00000000..0d4d8814 Binary files /dev/null and b/KKUH Screenshots/Medical File.jpg differ diff --git a/KKUH Screenshots/My Appointments.jpg b/KKUH Screenshots/My Appointments.jpg new file mode 100755 index 00000000..4001441e Binary files /dev/null and b/KKUH Screenshots/My Appointments.jpg differ diff --git a/PatientAppAPNSAuthKey.p8 b/PatientAppAPNSAuthKey.p8 deleted file mode 100755 index 0515964e..00000000 --- a/PatientAppAPNSAuthKey.p8 +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgJ5XRSnefd1apSG/z -YJTQ55ffLMlPgKlGM9edg88mUZagCgYIKoZIzj0DAQehRANCAATSA2MbS+J0cQsc -uBU0xaoxOUgGvnHCQSEK4t22i8eeKPPhH6RHJhK1ugPvj+Eyadf7j6pn3QRonEJu -mIL+qvqC ------END PRIVATE KEY----- \ No newline at end of file diff --git a/android/Patient_App_KKUH_KeyStore b/android/Patient_App_KKUH_KeyStore new file mode 100644 index 00000000..94f63b73 Binary files /dev/null and b/android/Patient_App_KKUH_KeyStore differ diff --git a/android/app/Patient_App_KKUH_KeyStore b/android/app/Patient_App_KKUH_KeyStore new file mode 100644 index 00000000..94f63b73 Binary files /dev/null and b/android/app/Patient_App_KKUH_KeyStore differ diff --git a/android/app/build.gradle b/android/app/build.gradle index c2d082a2..1ccb900d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,40 +1,16 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -//if (flutterRoot == null) { -// throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -//} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} +plugins { + id "com.android.application" + id "kotlin-android" + id "com.google.gms.google-services" + id "dev.flutter.flutter-gradle-plugin" -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' } - def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } -apply plugin: 'com.android.application' -//apply plugin: 'com.huawei.agconnect' -apply plugin: 'kotlin-android' -apply plugin: 'com.google.gms.google-services' -//apply plugin: 'com.google.firebase.crashlytics' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - - configurations.all { c -> c.resolutionStrategy.eachDependency { @@ -46,41 +22,34 @@ configurations.all { } } -//configurations.all { -// resolutionStrategy { -// force 'androidx.core:core-ktx:1.6.0' -// } -//} android { - compileSdkVersion 34 -// ndkVersion "24.0.8215888" + namespace = "sa.edu.kku.kkuMcApp" + compileSdkVersion 35 + ndkVersion = "27.0.12077973" - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 // Changed from VERSION_21 + targetCompatibility JavaVersion.VERSION_11 // Changed from VERSION_21 + coreLibraryDesugaringEnabled true // (Optional, for using Java 8+ APIs on older Android versions) } - lintOptions { - disable 'MissingTranslation' - checkReleaseBuilds false + kotlinOptions { + jvmTarget = '11' // Changed from '21' } - defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "sa.edu.kku.kkuMcApp" - minSdkVersion 24 - targetSdkVersion 34 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdkVersion 26 + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName multiDexEnabled true - } - sourceSets.main { - jniLibs.srcDir 'src/main/libs' - jni.srcDirs = [] //disable automatic ndk-build call } + signingConfigs { release { keyAlias keystoreProperties['keyAlias'] @@ -91,43 +60,25 @@ android { } buildTypes { - debug { - debuggable true - signingConfig signingConfigs.debug -// ndk { -// abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' -// } + buildTypes { + release { + shrinkResources false // Optional: Set to true to shrink resources + minifyEnabled false // Set to true to enable code shrinking and obfuscation + signingConfig signingConfigs.release + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + debug { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } } - release { - debuggable false - signingConfig signingConfigs.release - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - staging { - // Specifies a sorted list of fallback build types that the - // plugin should try to use when a dependency does not include a - // "staging" build type. You may specify as many fallbacks as you - // like, and the plugin selects the first build type that's - // available in the dependency. - matchingFallbacks = ['debug', 'qa', 'release'] - } - } - - packagingOptions { - exclude 'META-INF/proguard/androidx-annotations.pro' -// pickFirst 'lib/x86/libc++_shared.so' -// pickFirst 'lib/x86_64/libc++_shared.so' -// pickFirst 'lib/armeabi-v7a/libc++_shared.so' -// pickFirst 'lib/arm64-v8a/libc++_shared.so' -// pickFirst '**/*.so' - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + } + packaging { + jniLibs { + useLegacyPackaging true + } } } @@ -135,38 +86,19 @@ flutter { source '../..' } +repositories { + maven { url 'https://developer.huawei.com/repo/' } +} + dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "com.google.firebase:firebase-messaging:21.0.0" -// implementation ('com.google.firebase:firebase-inappmessaging-display:19.1.2',{ -// exclude group: 'com.google.protobuf',module: 'protobuf-javalite' -// exclude group: 'com.google.protobuf',module: 'protobuf-lite' -// }) + implementation platform("com.google.firebase:firebase-bom:33.14.0") // Firebase BoM + implementation "com.google.firebase:firebase-analytics" // Firebase Analytics + implementation"com.google.firebase:firebase-messaging"// Firebase Messaging implementation 'pub.devrel:easypermissions:3.0.0' -// implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0' - // implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0' implementation 'com.google.guava:guava:27.0.1-android' // Dependency on local binaries implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.google.code.gson:gson:2.8.6' - - // Dependency on a remote binary -// implementation 'com.example.android:app-magic:12.3' - - - implementation "us.zoom.videosdk:zoomvideosdk-core:1.10.1" - implementation "us.zoom.videosdk:zoomvideosdk-annotation:1.10.1" - implementation "us.zoom.videosdk:zoomvideosdk-videoeffects:1.10.1" - - // Native Dependency - -// implementation "us.zoom.videosdk:ZoomVideoSDK:1.10.11" -// implementation group: 'us.zoom.videosdk', name: 'zoomvideosdk-core', version: '1.10.11' - - implementation "us.zoom.videosdk:zoomvideosdk-core:1.10.1" - implementation "us.zoom.videosdk:zoomvideosdk-annotation:1.10.1" - implementation "us.zoom.videosdk:zoomvideosdk-videoeffects:1.10.1" - // implementation "org.jetbrains.anko:anko-commons:0.10.4" implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0' @@ -178,5 +110,6 @@ dependencies { implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.appcompat:appcompat:1.3.1' androidTestImplementation "androidx.test:core:1.4.0" - + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" } diff --git a/android/app/key.properties b/android/app/key.properties new file mode 100644 index 00000000..249d25fe --- /dev/null +++ b/android/app/key.properties @@ -0,0 +1,4 @@ +storePassword=KKUH54321 +keyPassword=KKUH54321 +keyAlias=key +storeFile=Patient_App_KKUH_KeyStore \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 84ae9182..b4a29214 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,32 +6,68 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - + - - + + + + @@ -39,19 +75,24 @@ - - - + + + + - - - - + + + + - + @@ -59,26 +100,28 @@ + android:icon="@mipmap/ic_launcher" + android:label="KKUMC" + android:screenOrientation="sensorPortrait" + android:showOnLockScreen="true" + android:usesCleartextTraffic="true" + tools:replace="android:extractNativeLibs"> - + + android:windowSoftInputMode="adjustResize" + tools:node="merge"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/app/src/main/ic_launcher-playstore.png index 8a881bee..a8d4250e 100644 Binary files a/android/app/src/main/ic_launcher-playstore.png and b/android/app/src/main/ic_launcher-playstore.png differ diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/Application.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/Application.kt index e234b5c0..aecad7b4 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/Application.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/Application.kt @@ -1,59 +1,22 @@ -//package com.cloud.diplomaticquarterapp package sa.edu.kku.kkuMcApp +import android.app.Application import com.facebook.stetho.Stetho -import io.flutter.app.FlutterApplication -import io.flutter.plugin.common.PluginRegistry -import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback -//import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService -class Application : FlutterApplication(), PluginRegistrantCallback { +class Application : Application() { override fun onCreate() { super.onCreate() - // FlutterFirebaseMessagingService.setPluginRegistrant(this) - -// Stetho.initializeWithDefaults(this); - // Create an InitializerBuilder - // Create an InitializerBuilder val initializerBuilder = Stetho.newInitializerBuilder(this) - - // Enable Chrome DevTools initializerBuilder.enableWebKitInspector( - Stetho.defaultInspectorModulesProvider(this) + Stetho.defaultInspectorModulesProvider(this) ) - // Enable command line interface initializerBuilder.enableDumpapp( - Stetho.defaultDumperPluginsProvider(this) + Stetho.defaultDumperPluginsProvider(this) ) - - // Use the InitializerBuilder to generate an Initializer val initializer = initializerBuilder.build() - - - // Initialize Stetho with the Initializer Stetho.initialize(initializer) } - - override fun registerWith(registry: PluginRegistry) { - // io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")); - } -} - -//import io.flutter.app.FlutterApplication -//import io.flutter.plugin.common.PluginRegistry -//import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback -//import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService -// -//class Application : FlutterApplication(), PluginRegistrantCallback { -// override fun onCreate() { -// super.onCreate() -// FlutterFirebaseMessagingService.setPluginRegistrant(this) -// } -// -// override fun registerWith(registry: PluginRegistry?) { -// FirebaseCloudMessagingPluginRegistrant.registerWith(registry) -// } -//} \ No newline at end of file +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/FirebaseCloudMessagingPluginRegistrant.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/FirebaseCloudMessagingPluginRegistrant.kt index df471796..6dbc6833 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/FirebaseCloudMessagingPluginRegistrant.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/FirebaseCloudMessagingPluginRegistrant.kt @@ -1,25 +1,32 @@ -//package com.cloud.diplomaticquarterapp -package com.ejada.hmg - -import io.flutter.plugin.common.PluginRegistry -//import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin - -object FirebaseCloudMessagingPluginRegistrant { - fun registerWith(registry: PluginRegistry?) { - if (alreadyRegisteredWith(registry)) { - return - } - // FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")) +package sa.edu.kku.kkuMcApp + +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.embedding.engine.plugins.activity.ActivityAware +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding + +object FirebaseCloudMessagingPluginRegistrant : FlutterPlugin, ActivityAware { + + override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { + // Register Firebase Messaging plugin here if needed + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + // Cleanup if necessary + } + + override fun onAttachedToActivity(binding: ActivityPluginBinding) { + // Handle activity-specific plugin registration + } + + override fun onDetachedFromActivityForConfigChanges() { + // Handle activity detachment for configuration changes + } + + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { + // Handle reattachment to activity after configuration changes } - private fun alreadyRegisteredWith(registry: PluginRegistry?): Boolean { - val key: String? = FirebaseCloudMessagingPluginRegistrant::class.java.canonicalName - if (key?.let { registry?.hasPlugin(it) }!!) { - return true - } - if (registry != null) { - registry.registrarFor(key) - } - return false + override fun onDetachedFromActivity() { + // Handle activity detachment } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt deleted file mode 100644 index 724018fa..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt +++ /dev/null @@ -1,58 +0,0 @@ -//package com.ejada.hmg.geofence -// -//import com.google.android.gms.location.Geofence -//import com.google.gson.Gson -//import com.google.gson.reflect.TypeToken -// -//class GeoZoneModel { -// var GEOF_ID:Int = 0 -// var Radius:Int = 0 -// var Type:Int = 0 -// var ProjectID:Int = 0 -// -// var Description:String? = null -// var DescriptionN:String? = null -// var Latitude:String? = null -// var Longitude:String? = null -// var ImageURL:String? = null -// var IsCity:String? = null -// -// fun identifier():String{ -// return "$GEOF_ID" + "_hmg" -// } -// -// fun message():String{ -// return Description ?: "nil" -// } -// -// fun listFrom(jsonString: String) : List{ -// val type = object : TypeToken?>() {}.getType() -// return Gson().fromJson(jsonString, type) -// } -// -// fun toGeofence() : Geofence?{ -// if (!Latitude.isNullOrEmpty() && !Longitude.isNullOrEmpty() && Radius > 50) { -// val lat = Latitude!!.trim().toDoubleOrNull() -// val long = Longitude!!.trim().toDoubleOrNull() -// val rad = Radius.toFloat() -// if(lat != null && long != null){ -// -// val loiteringDelayMinutes:Int = 2 // in Minutes -// return Geofence.Builder() -// .setRequestId(identifier()) -// .setCircularRegion( -// lat, -// long, -// rad -// ) -// .setTransitionTypes(GeofenceTransition.ENTER_EXIT.value) -// .setNotificationResponsiveness(0) -// .setLoiteringDelay(loiteringDelayMinutes * 60 * 1000) -// .setExpirationDuration(Geofence.NEVER_EXPIRE) -// .build() -// } -// } -// return null -// } -// -//} diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt deleted file mode 100644 index 401595ca..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ /dev/null @@ -1,291 +0,0 @@ -//package com.ejada.hmg.geofence -// -//import android.Manifest -//import android.app.PendingIntent -//import android.content.Context -//import android.content.Intent -//import android.content.SharedPreferences -//import android.content.pm.PackageManager -//import android.location.Location -//import androidx.core.content.ContextCompat -//import com.ejada.hmg.geofence.intent_receivers.GeofenceBroadcastReceiver -//import com.ejada.hmg.geofence.intent_receivers.ReregisterGeofenceJobService -//import com.ejada.hmg.utils.* -//import com.google.android.gms.location.Geofence -//import com.google.android.gms.location.GeofencingClient -//import com.google.android.gms.location.GeofencingRequest -//import com.google.android.gms.location.LocationServices -//import com.google.gson.Gson -//import com.google.gson.reflect.TypeToken -// -//enum class GeofenceTransition(val value: Int) { -// ENTER(1), -// EXIT(2), -// DWELL(4), -// -// ENTER_EXIT((ENTER.value or EXIT.value)), -// DWELL_EXIT((DWELL.value or EXIT.value)); -// -// companion object { -// fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } -// } -// -// fun named(): String { -// if (value == 1) return "Enter" -// if (value == 2) return "Exit" -// if (value == 4) return "dWell" -// if (value == (ENTER.value or EXIT.value)) return "Enter or Exit" -// if (value == (DWELL.value or EXIT.value)) return "DWell or Exit" -// return "unknown" -// } -//} -// -//class HMG_Geofence { -// // https://developer.android.com/training/location/geofencing#java -// -// private lateinit var context: Context -// private lateinit var preferences: SharedPreferences -// private val gson = Gson() -// -// private lateinit var geofencingClient: GeofencingClient -// private val geofencePendingIntent: PendingIntent by lazy { -// val intent = Intent(context, GeofenceBroadcastReceiver::class.java) -// PendingIntent.getBroadcast( -// context, -// 0, -// intent, -// PendingIntent.FLAG_IMMUTABLE -// ) -// } -// -// companion object { -// -// var instance: HMG_Geofence? = null -// fun shared(context: Context): HMG_Geofence { -// if (instance == null) { -// instance = HMG_Geofence() -// instance?.context = context -// instance?.geofencingClient = LocationServices.getGeofencingClient(context) -// instance?.preferences = -// context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) -// } -// return instance!! -// } -// } -// -// private fun limitize(zones: List): List { -// var geoZones_ = zones -// if (zones.size > 100) -// geoZones_ = zones.subList(0, 99) -// return geoZones_ -// } -// -// -// fun register(completion: ((Boolean, java.lang.Exception?) -> Unit)) { -// unRegisterAll { status, exception -> -// val geoZones = getGeoZonesFromPreference(context) -// doRegister(geoZones) { status_, error -> -// completion.let { it(status_, error) } -// } -// } -// } -// -// fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit) { -// getActiveGeofences({ success -> -// removeActiveGeofences() -// if (success.isNotEmpty()) -// geofencingClient -// .removeGeofences(success) -// .addOnSuccessListener { -// completion(true, null) -// } -// .addOnFailureListener { -// completion(false, it) -// saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) -// } -// else -// completion(true, null) -// -// }, { failed -> -// // Nothing to do with failed geofences. -// }) -// } -// -// private fun doRegister( -// geoZones: List, -// completion: ((Boolean, java.lang.Exception?) -> Unit)? = null -// ) { -// if (geoZones.isEmpty()) -// return -// -// val geoZones_ = limitize(geoZones) -// -// fun buildGeofencingRequest(geofences: List): GeofencingRequest { -// return GeofencingRequest.Builder() -// .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) -// .addGeofences(geofences) -// .build() -// } -// -// getActiveGeofences({ active -> -// -// val geofences = mutableListOf() -// geoZones_.forEach { -// it.toGeofence()?.let { geof -> -// if (!active.contains(geof.requestId)) { // if not already registered then register -// geofences.add(geof) -// } -// } -// } -// -// if (checkPermission() && geofences.isNotEmpty()) { -// geofencingClient -// .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) -// .addOnSuccessListener { -// Logs.RegisterGeofence.save( -// context, -// "SUCCESS", -// "Successfuly registered the geofences", -// Logs.STATUS.SUCCESS -// ) -// saveActiveGeofence(geofences.map { it.requestId }, listOf()) -// completion?.let { it(true, null) } -// } -// .addOnFailureListener { exc -> -// Logs.RegisterGeofence.save( -// context, -// "FAILED_TO_REGISTER", -// "Failed to register geofence", -// Logs.STATUS.ERROR -// ) -// completion?.let { it(false, exc) } -// } -// -// // Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again]) -// HMGUtils.scheduleJob( -// context, -// ReregisterGeofenceJobService::class.java, -// ReregisterGeofenceJobService.JobID, -// ReregisterGeofenceJobService.TriggerIntervalDuration -// ) -// } -// -// }, null) -// -// } -// -// fun getGeoZonesFromPreference(context: Context): List { -// val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) -// val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") -// -// val geoZones = GeoZoneModel().listFrom(json!!) -// return geoZones -// } -// -// fun saveActiveGeofence(success: List, failed: List) { -// val jsonSuccess = gson.toJson(success) -// val jsonFailure = gson.toJson(failed) -// preferences.edit().putString(PREF_KEY_SUCCESS, jsonSuccess).apply() -// preferences.edit().putString(PREF_KEY_FAILED, jsonFailure).apply() -// } -// -// fun removeActiveGeofences() { -// preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply() -// preferences.edit().putString(PREF_KEY_FAILED, "[]").apply() -// } -// -// fun getActiveGeofences( -// success: (success: List) -> Unit, -// failure: ((failed: List) -> Unit)? -// ) { -// val type = object : TypeToken?>() {}.type -// -// val jsonSuccess = preferences.getString(PREF_KEY_SUCCESS, "[]") -// val success = gson.fromJson>(jsonSuccess, type) -// success(success) -// -// if (failure != null) { -// val jsonFailure = preferences.getString(PREF_KEY_FAILED, "[]") -// val failed = gson.fromJson>(jsonFailure, type) -// failure(failed) -// } -// -// } -// -// private fun checkPermission(): Boolean { -// return ContextCompat.checkSelfPermission( -// context, -// Manifest.permission.ACCESS_FINE_LOCATION -// ) == PackageManager.PERMISSION_GRANTED -// } -// -// fun getPatientID(): Int? { -// var profileJson = preferences.getString("flutter.imei-user-data", null) -// if (profileJson == null) -// profileJson = preferences.getString("flutter.user-profile", null) -// -// val type = object : TypeToken?>() {}.type -// return gson.fromJson?>(profileJson, type) -// ?.get("PatientID") -// .toString() -// .toDoubleOrNull() -// ?.toInt() -// } -// -// -// fun handleEvent( -// triggerGeofences: List, -// location: Location, -// transition: GeofenceTransition -// ) { -// getPatientID()?.let { patientId -> -// getActiveGeofences({ activeGeofences -> -// -// triggerGeofences.forEach { geofence -> -// // Extract PointID from 'geofence.requestId' and find from active geofences -// val pointID = -// activeGeofences.firstOrNull { it == geofence.requestId }?.split('_') -// ?.first() -// if (!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null) { -// -// val body = mutableMapOf( -// "PointsID" to pointID.toIntOrNull(), -// "GeoType" to transition.value, -// "PatientID" to patientId -// ) -// body.putAll(HMGUtils.defaultHTTPParams(context)) -// -// httpPost>(API.LOG_GEOFENCE, body, { response -> -// saveLog( -// context, -// "HMG_GEOFENCE_NOTIFY", -// "Success: Notified to server\uD83D\uDE0E." -// ) -// sendNotification( -// context, -// transition.named(), -// geofence.requestId, -// "Notified to server.😎" -// ) -// }, { exception -> -// val errorMessage = "${transition.named()}, ${geofence.requestId}" -// saveLog( -// context, -// "HMG_GEOFENCE_NOTIFY", -// "failed: $errorMessage | error: ${exception.localizedMessage}" -// ) -// sendNotification( -// context, -// transition.named(), -// geofence.requestId, -// "Failed to notify server😔 -> ${exception.localizedMessage}" -// ) -// }) -// -// } -// } -// -// }, null) -// } -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt deleted file mode 100644 index b83950e9..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt +++ /dev/null @@ -1,71 +0,0 @@ -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.annotation.SuppressLint -//import android.content.BroadcastReceiver -//import android.content.Context -//import android.content.Intent -//import android.util.Log -//import com.ejada.hmg.geofence.GeofenceTransition -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.ejada.hmg.utils.Logs -//import com.google.android.gms.location.GeofenceStatusCodes -//import com.google.android.gms.location.GeofencingEvent -// -//class GeofenceBroadcastReceiver : BroadcastReceiver() { -// private val LOG_TAG = "GeofenceBroadcastReceiver" -// -// @SuppressLint("LongLogTag") -// override fun onReceive(context: Context, intent: Intent) { -// -// val geofencingEvent = GeofencingEvent.fromIntent(intent) -// if (geofencingEvent != null) { -// if (geofencingEvent.hasError()) { -// val errorMessage = -// GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) -// Log.e(LOG_TAG, errorMessage) -// -// Logs.GeofenceEvent.save( -// context, -// LOG_TAG, -// "Error while triggering geofence event", -// Logs.STATUS.ERROR -// ) -// doReRegisterIfRequired(context, geofencingEvent.errorCode) -// -// return -// } -// } -// if (geofencingEvent != null) { -// Logs.GeofenceEvent.save( -// context, -// LOG_TAG, -// "Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences?.map { it.requestId }}", -// Logs.STATUS.SUCCESS -// ) -// geofencingEvent.triggeringLocation?.let { -// geofencingEvent.triggeringGeofences?.let { it1 -> -// HMG_Geofence.shared(context).handleEvent( -// it1, -// it, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition) -// ) -// } -// } -// }; -// -// } -// -// fun doReRegisterIfRequired(context: Context, errorCode: Int) { -// val errorRequiredReregister = listOf( -// GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, -// GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT -// ) -// -// if (errorRequiredReregister.contains(errorCode)) -// HMG_Geofence.shared(context).register() { status, error -> -// -// } -// -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt deleted file mode 100644 index 8396835c..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt +++ /dev/null @@ -1,16 +0,0 @@ -// -// -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.content.BroadcastReceiver -//import android.content.Context -//import android.content.Intent -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.google.android.gms.location.GeofenceStatusCodes -// -//class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() { -// override fun onReceive(context: Context, intent: Intent) { -// GeofenceTransitionsJobIntentService.enqueueWork(context, intent) -// } -// -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt deleted file mode 100644 index 61756393..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt +++ /dev/null @@ -1,43 +0,0 @@ -// -// -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.content.Context -//import sa.edu.kku.kkuMcApp.R -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.google.android.gms.common.api.ApiException -//import com.google.android.gms.location.GeofenceStatusCodes -// -//object GeofenceErrorMessages { -// fun getErrorString(context: Context, e: Exception): String { -// return if (e is ApiException) { -// getErrorString(context, e.statusCode) -// } else { -// context.resources.getString(R.string.geofence_unknown_error) -// } -// } -// -// fun getErrorString(context: Context, errorCode: Int): String { -// val resources = context.resources -// val errorMessage = when (errorCode) { -// GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE -> -// resources.getString(R.string.geofence_not_available) -// -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES -> -// resources.getString(R.string.geofence_too_many_geofences) -// -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS -> -// resources.getString(R.string.geofence_too_many_pending_intents) -// -// GeofenceStatusCodes.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION -> -// resources.getString(R.string.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION) -// -// GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT -> -// resources.getString(R.string.GEOFENCE_REQUEST_TOO_FREQUENT) -// -// else -> resources.getString(R.string.geofence_unknown_error) -// } -// -// return errorMessage -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt deleted file mode 100644 index 254a56fb..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt +++ /dev/null @@ -1,97 +0,0 @@ -///* -// * Copyright (c) 2018 Razeware LLC -// * -// * Permission is hereby granted, free of charge, to any person obtaining a copy -// * of this software and associated documentation files (the "Software"), to deal -// * in the Software without restriction, including without limitation the rights -// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// * copies of the Software, and to permit persons to whom the Software is -// * furnished to do so, subject to the following conditions: -// * -// * The above copyright notice and this permission notice shall be included in -// * all copies or substantial portions of the Software. -// * -// * Notwithstanding the foregoing, you may not use, copy, modify, merge, publish, -// * distribute, sublicense, create a derivative work, and/or sell copies of the -// * Software in any work that is designed, intended, or marketed for pedagogical or -// * instructional purposes related to programming, coding, application development, -// * or information technology. Permission for such use, copying, modification, -// * merger, publication, distribution, sublicensing, creation of derivative works, -// * or sale is expressly withheld. -// * -// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// * THE SOFTWARE. -// */ -// -// -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.content.Context -//import android.content.Intent -//import android.util.Log -//import androidx.core.app.JobIntentService -//import com.ejada.hmg.geofence.GeofenceTransition -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.ejada.hmg.utils.saveLog -//import com.google.android.gms.location.GeofenceStatusCodes -//import com.google.android.gms.location.GeofencingEvent -// -//class GeofenceTransitionsJobIntentService : JobIntentService() { -// -// companion object { -// private const val LOG_TAG = "GeoTrIntentService" -// -// private const val JOB_ID = 95902 -// var context_: Context? = null -// fun enqueueWork(context: Context, intent: Intent) { -// context_ = context -// enqueueWork( -// context, -// GeofenceTransitionsJobIntentService::class.java, JOB_ID, -// intent) -// } -// } -// -// override fun onHandleWork(intent: Intent) { -// val geofencingEvent = GeofencingEvent.fromIntent(intent) -// if (geofencingEvent != null) { -// if (geofencingEvent.hasError()) { -// val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode) -// Log.e(LOG_TAG, errorMessage) -// -// -// saveLog(context_!!,LOG_TAG,errorMessage) -// doReRegisterIfRequired(context_!!, geofencingEvent.errorCode) -// -// return -// } -// } -// -// if (geofencingEvent != null) { -// geofencingEvent.triggeringGeofences?.let { geofencingEvent.triggeringLocation?.let { it1 -> -// HMG_Geofence.shared(context_!!).handleEvent(it, -// it1, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)) -// } } -// }; -// -// } -// -// -// fun doReRegisterIfRequired(context: Context, errorCode: Int){ -// val errorRequiredReregister = listOf( -// GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, -// GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, -// GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT -// ) -// -// if(errorRequiredReregister.contains(errorCode)) -// HMG_Geofence.shared(context).register(){ status, exc -> } -// -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt deleted file mode 100644 index 4be5c42b..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt +++ /dev/null @@ -1,23 +0,0 @@ -// -// -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.content.BroadcastReceiver -//import android.content.Context -//import android.content.Intent -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.ejada.hmg.utils.PREFS_STORAGE -// -//class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ -// override fun onReceive(context: Context, intent: Intent) { -// -// if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { -//// if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) { -// val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) -// pref.edit().putString("REBOOT_DETECTED","YES").apply() -// -// HMG_Geofence.shared(context).register(){ status, error -> } -// } -// } -// -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt deleted file mode 100644 index 5531ddad..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt +++ /dev/null @@ -1,25 +0,0 @@ -// -// -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.content.BroadcastReceiver -//import android.content.Context -//import android.content.Intent -//import android.location.LocationManager -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.ejada.hmg.utils.HMGUtils -//import com.ejada.hmg.utils.PREFS_STORAGE -// -//class LocationProviderChangeReceiver : BroadcastReceiver() { -// private val LOG_TAG = "LocationProviderChangeReceiver" -// override fun onReceive(context: Context, intent: Intent) { -// -// if (LocationManager.PROVIDERS_CHANGED_ACTION.equals(intent.action)) { -// val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) -// pref.edit().putString("LOCATION_PROVIDER_CHANGE","YES").apply() -// -// HMG_Geofence.shared(context).register(){ s, e -> } -// } -// } -// -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt deleted file mode 100644 index 7df0037f..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt +++ /dev/null @@ -1,24 +0,0 @@ -//package com.ejada.hmg.geofence.intent_receivers -// -//import android.app.job.JobParameters -//import android.app.job.JobService -//import com.ejada.hmg.geofence.HMG_Geofence -//import com.ejada.hmg.utils.Logs -// -//class ReregisterGeofenceJobService : JobService(){ -// companion object{ -// val TriggerIntervalDuration:String = "06:00:00" -// val JobID = 918273 -// } -// override fun onStartJob(params: JobParameters?): Boolean { -// Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalDuration >> [HH:mm:ss]") -// HMG_Geofence.shared(applicationContext).register(){ status, error -> -// jobFinished(params, true) -// } -// return true -// } -// -// override fun onStopJob(params: JobParameters?): Boolean { -// return true -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt deleted file mode 100644 index 2ac59259..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt +++ /dev/null @@ -1,59 +0,0 @@ -package com.ejada.hmg.opentok - -import android.content.Context -import android.util.AttributeSet -import android.view.LayoutInflater -import android.view.View -import android.widget.FrameLayout -import android.widget.LinearLayout -//import com.ejada.hmg.R -import sa.edu.kku.kkuMcApp.R -import io.flutter.plugin.common.StandardMessageCodec -import io.flutter.plugin.platform.PlatformView -import io.flutter.plugin.platform.PlatformViewFactory - -class LocalVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) { - - companion object { - private lateinit var view: LocalVideoPlatformView - - fun getViewInstance(context: Context): LocalVideoPlatformView { - if(!this::view.isInitialized) { - view = LocalVideoPlatformView(context) - } - - return view - } - } - - override fun create(context: Context, viewId: Int, args: Any?): PlatformView { - return getViewInstance(context) - } -} - -class LocalVideoPlatformView(context: Context) : PlatformView { - private val videoContainer: LocalVideoContainer = LocalVideoContainer(context) - - val container get() = videoContainer.publisherContainer - - override fun getView(): View { - return videoContainer - } - - override fun dispose() {} -} - -class LocalVideoContainer @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyle: Int = 0, - defStyleRes: Int = 0 -) : LinearLayout(context, attrs, defStyle, defStyleRes) { - - var publisherContainer: FrameLayout private set - - init { - val view = LayoutInflater.from(context).inflate(R.layout.local_video, this, true) - publisherContainer = view.findViewById(R.id.publisher_container) - } -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt deleted file mode 100644 index 5142702a..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt +++ /dev/null @@ -1,181 +0,0 @@ -package com.ejada.hmg.opentok - -import android.content.Context -import android.os.Handler -import android.os.Looper -import android.util.Log -import android.view.ViewGroup -import com.facebook.stetho.urlconnection.StethoURLConnectionManager -import com.opentok.android.* -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel - - -enum class OpenTokSDKState { - LOGGED_OUT, - LOGGED_IN, - WAIT, - ERROR -} - -class OpenTok(private var context: Context, private var flutterEngine: FlutterEngine){ - private lateinit var remoteVideoPlatformView: RemoteVideoPlatformView - private lateinit var localVideoPlatformView: LocalVideoPlatformView - - init { - remoteVideoPlatformView = RemoteVideoFactory.getViewInstance(context) - flutterEngine - .platformViewsController - .registry - .registerViewFactory("remote-video-container", RemoteVideoFactory()) - - localVideoPlatformView = LocalVideoFactory.getViewInstance(context) - flutterEngine - .platformViewsController - .registry - .registerViewFactory("local-video-container", LocalVideoFactory()) - } - - private var session: Session? = null - private var publisher: Publisher? = null - private var subscriber: Subscriber? = null - - - - private val sessionListener: Session.SessionListener = object: Session.SessionListener { - override fun onConnected(session: Session) { - // Connected to session - Log.d("MainActivity", "Connected to session ${session.sessionId}") - - publisher = Publisher.Builder(context).build().apply { - setPublisherListener(publisherListener) - renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) - - view.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) - localVideoPlatformView.container.addView(view) - } - - notifyFlutter(OpenTokSDKState.LOGGED_IN) - session.publish(publisher) - } - - override fun onDisconnected(session: Session) { - notifyFlutter(OpenTokSDKState.LOGGED_OUT) - } - - override fun onStreamReceived(session: Session, stream: Stream) { - Log.d( - "MainActivity", - "onStreamReceived: New Stream Received " + stream.streamId + " in session: " + session.sessionId - ) - if (subscriber == null) { - subscriber = Subscriber.Builder(context, stream).build().apply { - renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) - setSubscriberListener(subscriberListener) - session.subscribe(this) - - remoteVideoPlatformView.container.addView(view) - } - } - } - - override fun onStreamDropped(session: Session, stream: Stream) { - Log.d( - "MainActivity", - "onStreamDropped: Stream Dropped: " + stream.streamId + " in session: " + session.sessionId - ) - - if (subscriber != null) { - subscriber = null - - remoteVideoPlatformView.container.removeAllViews() - } - } - - override fun onError(session: Session, opentokError: OpentokError) { - Log.d("MainActivity", "Session error: " + opentokError.message) - notifyFlutter(OpenTokSDKState.ERROR) - } - } - - private val publisherListener: PublisherKit.PublisherListener = object : PublisherKit.PublisherListener { - override fun onStreamCreated(publisherKit: PublisherKit, stream: Stream) { - Log.d("MainActivity", "onStreamCreated: Publisher Stream Created. Own stream " + stream.streamId) - } - - override fun onStreamDestroyed(publisherKit: PublisherKit, stream: Stream) { - Log.d("MainActivity", "onStreamDestroyed: Publisher Stream Destroyed. Own stream " + stream.streamId) - } - - override fun onError(publisherKit: PublisherKit, opentokError: OpentokError) { - Log.d("MainActivity", "PublisherKit onError: " + opentokError.message) - notifyFlutter(OpenTokSDKState.ERROR) - } - } - - var subscriberListener: SubscriberKit.SubscriberListener = object : SubscriberKit.SubscriberListener { - override fun onConnected(subscriberKit: SubscriberKit) { - Log.d("MainActivity", "onConnected: Subscriber connected. Stream: " + subscriberKit.stream.streamId) - } - - override fun onDisconnected(subscriberKit: SubscriberKit) { - Log.d("MainActivity", "onDisconnected: Subscriber disconnected. Stream: " + subscriberKit.stream.streamId) - notifyFlutter(OpenTokSDKState.LOGGED_OUT) - } - - override fun onError(subscriberKit: SubscriberKit, opentokError: OpentokError) { - Log.d("MainActivity", "SubscriberKit onError: " + opentokError.message) - notifyFlutter(OpenTokSDKState.ERROR) - } - } - - fun initSession(call: MethodCall, result: MethodChannel.Result) { - - val apiKey = requireNotNull(call.argument("apiKey")) - val sessionId = requireNotNull(call.argument("sessionId")) - val token = requireNotNull(call.argument("token")) - - notifyFlutter(OpenTokSDKState.WAIT) - session = Session.Builder(context, apiKey, sessionId).build() - session?.setSessionListener(sessionListener) - session?.connect(token) - result.success("") - } - - fun swapCamera(call: MethodCall, result: MethodChannel.Result) { - publisher?.cycleCamera() - result.success(true) - } - - fun toggleAudio(call: MethodCall, result: MethodChannel.Result) { - if (publisher != null) { - publisher?.publishAudio = !(publisher!!.publishAudio) - result.success(true) - }else{ - result.success(false) - } - } - - fun toggleVideo(call: MethodCall, result: MethodChannel.Result) { - if (publisher != null) { - publisher?.publishVideo = !(publisher!!.publishVideo) - result.success(true) - }else{ - result.success(false) - } - } - - fun hangupCall(call: MethodCall, result: MethodChannel.Result) { - session?.disconnect() - result.success(true) - } - - private fun notifyFlutter(state: OpenTokSDKState) { - Handler(Looper.getMainLooper()).post { - MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "OpenTok-Platform-Bridge") - .invokeMethod("updateState", state.toString()) - } - } -} diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt deleted file mode 100644 index d6ee9408..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt +++ /dev/null @@ -1,59 +0,0 @@ -package com.ejada.hmg.opentok - -import android.content.Context -import android.util.AttributeSet -import android.view.LayoutInflater -import android.view.View -import android.widget.FrameLayout -import android.widget.LinearLayout -//import com.ejada.hmg.R -import sa.edu.kku.kkuMcApp.R -import io.flutter.plugin.common.StandardMessageCodec -import io.flutter.plugin.platform.PlatformView -import io.flutter.plugin.platform.PlatformViewFactory - -class RemoteVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) { - - companion object { - private lateinit var view: RemoteVideoPlatformView - - fun getViewInstance(context: Context): RemoteVideoPlatformView { - if(!this::view.isInitialized) { - view = RemoteVideoPlatformView(context) - } - - return view - } - } - - override fun create(context: Context, viewId: Int, args: Any?): PlatformView { - return getViewInstance(context) - } -} - -class RemoteVideoPlatformView(context: Context) : PlatformView { - private val videoContainer: RemoteVideoContainer = RemoteVideoContainer(context) - - val container get() = videoContainer.subscriberContainer - - override fun getView(): View { - return videoContainer - } - - override fun dispose() {} -} - -class RemoteVideoContainer @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyle: Int = 0, - defStyleRes: Int = 0 -) : LinearLayout(context, attrs, defStyle, defStyleRes) { - - var subscriberContainer: FrameLayout private set - - init { - val view = LayoutInflater.from(context).inflate(R.layout.remote_video, this, true) - subscriberContainer = view.findViewById(R.id.subscriber_container) - } -} \ No newline at end of file diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png deleted file mode 100755 index 2d394f83..00000000 Binary files a/android/app/src/main/res/drawable/app_icon.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/food.png b/android/app/src/main/res/drawable/food.png deleted file mode 100644 index 41b394d3..00000000 Binary files a/android/app/src/main/res/drawable/food.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100755 index 00000000..ca3826a4 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/me.png b/android/app/src/main/res/drawable/me.png deleted file mode 100644 index ba75bc55..00000000 Binary files a/android/app/src/main/res/drawable/me.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/sample_large_icon.png b/android/app/src/main/res/drawable/sample_large_icon.png deleted file mode 100644 index f354ca23..00000000 Binary files a/android/app/src/main/res/drawable/sample_large_icon.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/secondary_icon.png b/android/app/src/main/res/drawable/secondary_icon.png deleted file mode 100644 index 9de9ff41..00000000 Binary files a/android/app/src/main/res/drawable/secondary_icon.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..dfc4307a Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index 63f215f9..00000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..61cb21c7 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp deleted file mode 100644 index 21af3bdb..00000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..fb945cbd Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index e4defddb..00000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..16b99780 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 1c45c138..00000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..5c8fb3ec Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp deleted file mode 100644 index 67782630..00000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..c470c59a Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index f41ce914..00000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..e68eb987 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index f27b099e..00000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..61a5aea3 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 42025873..00000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..850c1f58 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 3e7c4182..00000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..4070ce10 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 880849d8..00000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..9ba7cf5d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 490ec494..00000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..53ac4eb5 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index bf5ddbb8..00000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..8f0fb09e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index 9fedaa47..00000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..86639b6a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index c92f578f..00000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..49711484 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index 6471629c..00000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/android/app/src/main/res/playstore-icon.png b/android/app/src/main/res/playstore-icon.png new file mode 100644 index 00000000..40797293 Binary files /dev/null and b/android/app/src/main/res/playstore-icon.png differ diff --git a/android/build.gradle b/android/build.gradle index 1dd033de..29ea7d75 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.8.0' + ext.kotlin_version = '1.8.10' // if (System.properties['os.arch'] == "aarch64") { // // For M1 Users we need to use the NDK 24 which added support for aarch64 @@ -26,7 +26,9 @@ buildscript { classpath 'com.google.gms:google-services:4.3.8' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' // classpath 'com.huawei.agconnect:agcp:1.5.2.300' - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' +// classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4' // or newer + } } @@ -45,6 +47,17 @@ allprojects { url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local" } } + subprojects { + afterEvaluate { project -> + if (project.hasProperty('android')) { + project.android { + if (namespace == null) { + namespace project.group + } + } + } + } + } } rootProject.buildDir = '../build' @@ -64,3 +77,37 @@ configurations.all { force 'androidx.core:core-ktx:1.6.0' } } + +//allprojects { +// repositories { +// google() +// mavenCentral() +// maven { url 'https://developer.huawei.com/repo/' } +// } +// subprojects { +// afterEvaluate { project -> +// if (project.hasProperty('android')) { +// project.android { +// if (namespace == null) { +// namespace project.group +// } +// } +// } +// } +// } +//} +// +// +//rootProject.buildDir = '../build' +//subprojects { +// project.buildDir = "${rootProject.buildDir}/${project.name}" +//} +//subprojects { +// project.evaluationDependsOn(':app') +//} +// +//tasks.register("clean", Delete) { +// delete rootProject.layout.buildDirectory +//} +// +// diff --git a/android/gradle.properties b/android/gradle.properties index 06a44c05..03098bce 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ -org.gradle.jvmargs=-Xmx4096m -#android.enableR8=true +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true -android.suppressUnsupportedCompileSdk=33 +android.enableR8.fullMode=false +kotlin.jvm.target.validation.mode = IGNORE diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index f0c638fd..f3b6c6d7 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jul 14 15:55:18 AST 2021 +#Wed Jun 18 09:27:00 AST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/android/key.properties b/android/key.properties new file mode 100644 index 00000000..249d25fe --- /dev/null +++ b/android/key.properties @@ -0,0 +1,4 @@ +storePassword=KKUH54321 +keyPassword=KKUH54321 +keyAlias=key +storeFile=Patient_App_KKUH_KeyStore \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14fb..7be84402 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,78 @@ -include ':app' +//include ':app' +// +//def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +// +//def plugins = new Properties() +//def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +//if (pluginsFile.exists()) { +// pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +//} +// +//plugins.each { name, path -> +// def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() +// include ":$name" +// project(":$name").projectDir = pluginDirectory +//} -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + // Add Huawei's Maven repo for plugins + maven { url 'https://developer.huawei.com/repo/' } + } + + dependencyResolutionManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url 'https://developer.huawei.com/repo/' } + + } + } + + resolutionStrategy { + eachPlugin { + if (it.requested.id.getNamespace() == 'com.huawei.agconnect') { + println ">> ${it.requested.id.id}" + if (it.requested.id.id == 'com.huawei.agconnect.agcp') { + it.useModule('com.huawei.agconnect:agcp:1.7.3.302') + } + if (it.requested.id.id == 'com.huawei.agconnect.apms') { + it.useModule('com.huawei.agconnect:agconnect-apms-plugin:1.6.1.300') + } + println ">> ${it.target}" + } else { + println "> ${it.target}" + } + } + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version '8.10.1' apply false + id("org.jetbrains.kotlin.android") version "2.1.10" apply false + id("com.google.gms.google-services") version "4.4.2" apply false + id("com.google.firebase.crashlytics") version "3.0.3" apply false + + id ("com.huawei.agconnect.agcp") version "1.7.3.302" apply false + id ("com.huawei.agconnect.apms") version "1.6.1.300" apply false } + + + +include ":app" diff --git a/assets/images/new/ic_logo_old.png b/assets/images/new/ic_logo_old.png new file mode 100644 index 00000000..efa2f9e2 Binary files /dev/null and b/assets/images/new/ic_logo_old.png differ diff --git a/assets/images/new/ic_logo_old2.png b/assets/images/new/ic_logo_old2.png new file mode 100644 index 00000000..d410a082 Binary files /dev/null and b/assets/images/new/ic_logo_old2.png differ diff --git a/google-services.json b/google-services.json new file mode 100644 index 00000000..a11b41a2 --- /dev/null +++ b/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "218653915217", + "project_id": "kkumc-e0903", + "storage_bucket": "kkumc-e0903.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:218653915217:android:28ffffcec5fbf67c896070", + "android_client_info": { + "package_name": "sa.edu.kku.kkuMcApp" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCcN2iDIOH8X7yOikH95cZqyMqA9Kgc8P0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/google-services_DQ.json b/google-services_DQ.json deleted file mode 100644 index a4655794..00000000 --- a/google-services_DQ.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "project_info": { - "project_number": "864393916058", - "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com", - "project_id": "diplomaticquarter-d2385", - "storage_bucket": "diplomaticquarter-d2385.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923", - "android_client_info": { - "package_name": "com.cloud.diplomaticquarterapp" - } - }, - "oauth_client": [ - { - "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/google-services_HMG.json b/google-services_HMG.json deleted file mode 100644 index dd4038cf..00000000 --- a/google-services_HMG.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "815750722565", - "firebase_url": "https://api-project-815750722565.firebaseio.com", - "project_id": "api-project-815750722565", - "storage_bucket": "api-project-815750722565.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", - "android_client_info": { - "package_name": "com.ejada.hmg" - } - }, - "oauth_client": [ - { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index cb6be309..c5ff5d37 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 13.0 diff --git a/ios/Podfile b/ios/Podfile index 2f94bf89..aafb513e 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,7 +1,5 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '13.0' +platform :ios, '15.0' -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { @@ -13,14 +11,14 @@ project 'Runner', { def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + raise "#{generated_xcode_build_settings_path} must exist. Run flutter pub get first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) @@ -30,9 +28,10 @@ flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! - + pod 'OpenTok', '~> 2.22.0' pod 'VTO2Lib' + pod 'VonageWebRTC' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end @@ -40,48 +39,99 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) - target.build_configurations.each do |build_configuration| - build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ - '$(inherited)', - ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] -# 'PERMISSION_LOCATION=1', -# 'PERMISSION_CAMERA=1', -# 'PERMISSION_MICROPHONE=1', - ## dart: PermissionGroup.calendar - 'PERMISSION_EVENTS_FULL_ACCESS=1', - ## dart: PermissionGroup.reminders - 'PERMISSION_REMINDERS=1', - ] - build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' - build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' - xcconfig_path = build_configuration.base_configuration_reference.real_path - xcconfig = File.read(xcconfig_path) - xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") - File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } - - if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' - build_configuration.build_settings['DEVELOPMENT_TEAM'] = '686M4Y8589' - end + target.build_configurations.each do |config| + config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0' + config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end end - -post_integrate do |installer| - compiler_flags_key = 'COMPILER_FLAGS' - project_path = 'Pods/Pods.xcodeproj' - - project = Xcodeproj::Project.open(project_path) - project.targets.each do |target| - target.build_phases.each do |build_phase| - if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) - build_phase.files.each do |file| - if !file.settings.nil? && file.settings.key?(compiler_flags_key) - compiler_flags = file.settings[compiler_flags_key] - file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') - end - end - end - end - end - project.save() -end \ No newline at end of file +# +# # Uncomment this line to define a global platform for your project +# platform :ios, '18.0' +# +# # CocoaPods analytics sends network stats synchronously affecting flutter build latency. +# ENV['COCOAPODS_DISABLE_STATS'] = 'true' +# +# project 'Runner', { +# 'Debug' => :debug, +# 'Profile' => :release, +# 'Release' => :release, +# } +# +# def flutter_root +# generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) +# unless File.exist?(generated_xcode_build_settings_path) +# raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" +# end +# +# File.foreach(generated_xcode_build_settings_path) do |line| +# matches = line.match(/FLUTTER_ROOT\=(.*)/) +# return matches[1].strip if matches +# end +# raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +# end +# +# require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) +# +# flutter_ios_podfile_setup +# +# target 'Runner' do +# use_frameworks! +# use_modular_headers! +# +# pod 'OpenTok', '~> 2.22.0' +# pod 'VTO2Lib' +# pod 'VonageWebRTC' +# +# flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +# end +# +# post_install do |installer| +# installer.pods_project.targets.each do |target| +# flutter_additional_ios_build_settings(target) +# target.build_configurations.each do |build_configuration| +# build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ +# '$(inherited)', +# ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] +# # 'PERMISSION_LOCATION=1', +# # 'PERMISSION_CAMERA=1', +# # 'PERMISSION_MICROPHONE=1', +# ## dart: PermissionGroup.calendar +# 'PERMISSION_EVENTS_FULL_ACCESS=1', +# ## dart: PermissionGroup.reminders +# 'PERMISSION_REMINDERS=1', +# ] +# build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' +# build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0' +# xcconfig_path = build_configuration.base_configuration_reference.real_path +# xcconfig = File.read(xcconfig_path) +# xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") +# File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } +# +# if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' +# build_configuration.build_settings['DEVELOPMENT_TEAM'] = '686M4Y8589' +# end +# end +# end +# end +# +# post_integrate do |installer| +# compiler_flags_key = 'COMPILER_FLAGS' +# project_path = 'Pods/Pods.xcodeproj' +# +# project = Xcodeproj::Project.open(project_path) +# project.targets.each do |target| +# target.build_phases.each do |build_phase| +# if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) +# build_phase.files.each do |file| +# if !file.settings.nil? && file.settings.key?(compiler_flags_key) +# compiler_flags = file.settings[compiler_flags_key] +# file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') +# end +# end +# end +# end +# end +# project.save() +# end \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index fe5b6571..8eae49ce 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,16 +8,17 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 25EF2C382E019F2600247CC4 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25EF2C372E019F2600247CC4 /* AdSupport.framework */; }; 301C79AE27200D9F0016307B /* OpenTokRemoteVideoFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 301C79AD27200D9F0016307B /* OpenTokRemoteVideoFactory.swift */; }; 301C79B027200DED0016307B /* OpenTokLocalVideoFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 301C79AF27200DED0016307B /* OpenTokLocalVideoFactory.swift */; }; 306FE6C8271D790C002D6EFC /* OpenTokPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */; }; 306FE6CB271D8B73002D6EFC /* OpenTok.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6CA271D8B73002D6EFC /* OpenTok.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 762D738E274E42650063CE73 /* ring_30Sec.caf in Resources */ = {isa = PBXBuildFile; fileRef = 762D738C274E42650063CE73 /* ring_30Sec.caf */; }; 762D738F274E42650063CE73 /* ring_30Sec.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 762D738D274E42650063CE73 /* ring_30Sec.mp3 */; }; 76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; }; + 7A0E23D0399F3EA768A6BE49 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4340D6E6234AD9314FACDC21 /* Pods_Runner.framework */; }; 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 */; }; @@ -54,15 +55,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1303536B65CC5A06CD13E46B /* 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 = ""; }; 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 = ""; }; + 25EF2C372E019F2600247CC4 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; 301C79AD27200D9F0016307B /* OpenTokRemoteVideoFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokRemoteVideoFactory.swift; sourceTree = ""; }; 301C79AF27200DED0016307B /* OpenTokLocalVideoFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokLocalVideoFactory.swift; sourceTree = ""; }; 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = ""; }; 306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6EE8819867EC2775AB578377 /* 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 = ""; }; + 4340D6E6234AD9314FACDC21 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = ""; }; @@ -74,7 +76,7 @@ 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 838788A2BEDC4910F4B029A6 /* 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 = ""; }; + 7C45E76E74E472C3ED695EE8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -100,7 +102,7 @@ E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; - F2C7D3C4718A1DED85DA3AD4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + FE2073889F90CE83C83A4821 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -109,7 +111,8 @@ buildActionMask = 2147483647; files = ( E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, - 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */, + 7A0E23D0399F3EA768A6BE49 /* Pods_Runner.framework in Frameworks */, + 25EF2C382E019F2600247CC4 /* AdSupport.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -129,10 +132,11 @@ 555EAAA626EFB641859EF0BE /* Frameworks */ = { isa = PBXGroup; children = ( + 25EF2C372E019F2600247CC4 /* AdSupport.framework */, 76F2556027F1FFED0062C1CD /* PassKit.framework */, 76815B26275F381C00E66E94 /* HealthKit.framework */, E9620804255C2ED100D3A35D /* NetworkExtension.framework */, - 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */, + 4340D6E6234AD9314FACDC21 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -140,9 +144,9 @@ 605039E5DDF72C245F9765FE /* Pods */ = { isa = PBXGroup; children = ( - F2C7D3C4718A1DED85DA3AD4 /* Pods-Runner.debug.xcconfig */, - 838788A2BEDC4910F4B029A6 /* Pods-Runner.release.xcconfig */, - 6EE8819867EC2775AB578377 /* Pods-Runner.profile.xcconfig */, + 7C45E76E74E472C3ED695EE8 /* Pods-Runner.debug.xcconfig */, + FE2073889F90CE83C83A4821 /* Pods-Runner.release.xcconfig */, + 1303536B65CC5A06CD13E46B /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -245,15 +249,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */, + 87125FFA53C96E834B0EFF06 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */, - 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */, + 199074F92959CF6F5A10D1D6 /* [CP] Embed Pods Frameworks */, + 7AE5EAA594970411B124D526 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -270,7 +274,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -320,6 +324,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 199074F92959CF6F5A10D1D6 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -336,7 +357,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */ = { + 7AE5EAA594970411B124D526 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -353,24 +374,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */ = { + 87125FFA53C96E834B0EFF06 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -528,7 +532,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 686M4Y8589; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -546,7 +550,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = sa.edu.kku.kkuMcApp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -676,7 +680,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 686M4Y8589; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -694,7 +698,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = sa.edu.kku.kkuMcApp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -715,7 +719,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 686M4Y8589; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -733,7 +737,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = sa.edu.kku.kkuMcApp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index fab8f735..725870e1 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index d8e5e0f6..a017aeea 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -4,7 +4,7 @@ import GoogleMaps var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { let locationManager = CLLocationManager() var flutterViewController:MainFlutterVC! diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 00000000..d14e9845 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png b/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png new file mode 100644 index 00000000..6fc19b0f Binary files /dev/null and b/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png differ diff --git a/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png b/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png new file mode 100644 index 00000000..d14e9845 Binary files /dev/null and b/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png differ diff --git a/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png b/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png new file mode 100644 index 00000000..934e2020 Binary files /dev/null and b/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index c9a490f3..ceb3bcd1 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -30,6 +30,8 @@ FIVKSupportVideo + ITSAppUsesNonExemptEncryption + LSApplicationQueriesSchemes comgooglemaps @@ -39,9 +41,7 @@ LSRequiresIPhoneOS MinimumOSVersion - 11.0 - NFCReaderUsageDescription - This app requires NFC Usage access to allow for Online CheckIn for appointments. + 13.0 NSAppTransportSecurity NSAllowsArbitraryLoads @@ -69,10 +69,6 @@ This app requires contacts access to show incoming virtual consultation request. NSFaceIDUsageDescription This app requires Face ID to allow biometric authentication for app login. - NSHealthShareUsageDescription - This App need access to HealthKit to read heart rate & other data from your smart watch. - NSHealthUpdateUsageDescription - This App need access to HealthKit to read heart rate & other data from your smart watch. NSLocationAlwaysAndWhenInUseUsageDescription This App requires access to your location to show the nearest hospitals & ER Locations from your location. NSLocationAlwaysUsageDescription @@ -95,7 +91,6 @@ UIBackgroundModes - audio fetch remote-notification @@ -118,7 +113,5 @@ io.flutter.embedded_views_preview - ITSAppUsesNonExemptEncryption - diff --git a/ios/Runner/ar.lproj/LaunchScreen.strings b/ios/Runner/ar.lproj/LaunchScreen.strings new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/Runner/ar.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/ios/Runner/ar.lproj/Main.strings b/ios/Runner/ar.lproj/Main.strings new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/Runner/ar.lproj/Main.strings @@ -0,0 +1 @@ + diff --git a/ios/Runner/ar.lproj/Main_Custom.strings b/ios/Runner/ar.lproj/Main_Custom.strings new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/Runner/ar.lproj/Main_Custom.strings @@ -0,0 +1 @@ + diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart index 46ae7f80..f032a9bd 100644 --- a/lib/analytics/google-analytics.dart +++ b/lib/analytics/google-analytics.dart @@ -12,8 +12,6 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:geocoding/geocoding.dart'; @@ -21,6 +19,7 @@ import 'package:geolocator/geolocator.dart'; import 'flows/app_nav.dart'; import 'flows/hmg_services.dart'; +import 'package:firebase_analytics/firebase_analytics.dart'; typedef GALogger = Function(String name, {Map parameters}); @@ -41,11 +40,14 @@ _logger(String name, {Map? parameters}) async { }); try { - _analytics.logEvent(name: name.trim().toLowerCase(), parameters: parameters).then((value) { - // debugPrint('SUCCESS: Google analytics event "$name" sent with parameters $parameters'); - }).catchError((error) { - // debugPrint('ERROR: Google analytics event "$name" sent failed'); - }); + _analytics + .logEvent(name: name.trim().toLowerCase(), parameters: parameters?.map((k, v) => MapEntry(k, v as Object))) + .then((value) { + debugPrint('SUCCESS: Google analytics event "$name" sent with parameters $parameters'); + }) + .catchError((error) { + debugPrint('ERROR: Google analytics event "$name" sent failed'); + }); } catch (e) { print(e); } @@ -65,7 +67,7 @@ class GAnalytics { if (await PermissionService.isLocationEnabled()) { final location = await Geolocator.getCurrentPosition(); if (location != null && !location.isMocked) { - final places = await placemarkFromCoordinates(location.latitude, location.longitude,); + final places = await placemarkFromCoordinates(location.latitude, location.longitude); final countryCode = places.first.isoCountryCode; _analytics.setUserProperty(name: 'user_country', value: countryCode); } @@ -94,14 +96,16 @@ class NavObserver extends RouteObserver> { log(String className) { var event = AnalyticEvents.get(className); if (event.active != null) { - _analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( - (Object error) { - print('$FirebaseAnalyticsObserver: $error'); - }, - test: (Object error) { - return error is PlatformException; - }, - ); + _analytics + .setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className) + .catchError( + (Object error) { + print('$AnalyticEvents: $error'); + }, + test: (Object error) { + return error is PlatformException; + }, + ); } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 1974e4db..006128ac 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1,8 +1,9 @@ import 'dart:io'; -import 'package:amazon_payfort/amazon_payfort.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:amazon_payfort/amazon_payfort.dart'; + var MAX_SMALL_SCREEN = 660; final OPENTOK_API_KEY = '46209962'; @@ -338,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 20.9; +var VERSION_ID = 21.0; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 314ec125..81e9c8ca 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -184,7 +184,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 283093; //4609100 + // body['PatientID'] = 1071; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index d920f1e3..ecef969f 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 8fc9ee71..e7eb8931 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -81,7 +81,7 @@ class ProjectViewModel extends BaseViewModel { List selectedBodyPartList = []; - late StreamSubscription subscription; + late StreamSubscription> subscription; late double _latitude = 0.0; late double _longitude = 0.0; @@ -95,11 +95,12 @@ class ProjectViewModel extends BaseViewModel { ProjectViewModel() { try { loadSharedPrefLanguage(); - subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { - if (result == ConnectivityResult.mobile) { + subscription = Connectivity().onConnectivityChanged.listen((List result) { + if (result.contains(ConnectivityResult.mobile)) { isInternetConnection = true; - } else if (result == ConnectivityResult.wifi) { - } else if (result == ConnectivityResult.none) { + } else if (result.contains(ConnectivityResult.wifi)) { + isInternetConnection = true; + } else if (result.contains(ConnectivityResult.none)) { isInternetConnection = false; } notifyListeners(); diff --git a/lib/main.dart b/lib/main.dart index a0a584a5..5a32ce2a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -23,11 +23,13 @@ import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; import 'pages/pharmacies/compare-list.dart'; +import 'package:localstorage/localstorage.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); setupLocator(); + await initLocalStorage(); HttpOverrides.global = MyHttpOverrides(); runApp(MyApp()); } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart index 536af3cd..4483579f 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart @@ -100,7 +100,7 @@ class ConfirmDialog extends StatelessWidget { onClick(); Navigator.pop(context); }, - textColor: Theme.of(context).backgroundColor), + textColor: Theme.of(context).colorScheme.background), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index d0dd1094..0a49bb13 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,8 +25,6 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as gmaps; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class CMCLocationPage extends StatefulWidget { @@ -55,11 +53,11 @@ class _CMCLocationPageState extends State { ); late gmaps.LatLng currentPostion; AppSharedPreferences sharedPref = AppSharedPreferences(); - late HmsApiAvailability hmsApiAvailability; + // late HmsApiAvailability hmsApiAvailability; @override void initState() { - hmsApiAvailability = HmsApiAvailability(); + // hmsApiAvailability = HmsApiAvailability(); checkIsHuawei(); appMap = AppMap( @@ -93,11 +91,11 @@ class _CMCLocationPageState extends State { } checkIsHuawei() async { - await hmsApiAvailability!.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); + // await hmsApiAvailability!.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); } @override @@ -170,88 +168,89 @@ class _CMCLocationPageState extends State { ), ], ) - : PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - }, - selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: CustomColors.accentColor, - textColor: Colors.white, - onTap: () async { - print(selectedPlace); - AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( - customer: Customer( - addresses: [ - Addresses( - address1: selectedPlace!.formattedAddress, - address2: selectedPlace.formattedAddress, - customerAttributes: "", - city: "", - createdOnUtc: "", - id: "0", - latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(), - email: "", - ) - ], - ), - ); - - selectedPlace.addressComponents!.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer!.addresses![0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer!.addresses![0].city = e.longName; - } - }); - - await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - onPick(); - AppToast.showSuccessToast(message: "Address Added Successfully"); - } - Navigator.of(context).pop(); - }, - label: TranslationBase.of(context).addNewAddress, - ), - ], - ), - ), - ); - }, - initialPosition: gmaps.LatLng(latitude, longitude), - useCurrentLocation: showCurrentLocation, - ), + : SizedBox() + // : PlacePicker( + // apiKey: GOOGLE_API_KEY, + // enableMyLocationButton: true, + // automaticallyImplyAppBarLeading: false, + // autocompleteOnTrailingWhitespace: true, + // selectInitialPosition: true, + // autocompleteLanguage: projectViewModel.currentLanguage, + // enableMapTypeButton: true, + // searchForInitialValue: false, + // onPlacePicked: (PickResult result) { + // print(result.adrAddress); + // }, + // selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { + // print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + // + // return isSearchBarFocused + // ? Container() + // : FloatingCard( + // bottomPosition: 0.0, + // leftPosition: 0.0, + // rightPosition: 0.0, + // width: 500, + // borderRadius: BorderRadius.circular(12.0), + // child: state == SearchingState.Searching + // ? Center(child: CircularProgressIndicator()) + // : Container( + // margin: EdgeInsets.all(12), + // child: Column( + // children: [ + // SecondaryButton( + // color: CustomColors.accentColor, + // textColor: Colors.white, + // onTap: () async { + // print(selectedPlace); + // AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( + // customer: Customer( + // addresses: [ + // Addresses( + // address1: selectedPlace!.formattedAddress, + // address2: selectedPlace.formattedAddress, + // customerAttributes: "", + // city: "", + // createdOnUtc: "", + // id: "0", + // latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(), + // email: "", + // ) + // ], + // ), + // ); + // + // selectedPlace.addressComponents!.forEach((e) { + // if (e.types.contains("country")) { + // addNewAddressRequestModel.customer!.addresses![0].country = e.longName; + // } + // if (e.types.contains("postal_code")) { + // addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName; + // } + // if (e.types.contains("locality")) { + // addNewAddressRequestModel.customer!.addresses![0].city = e.longName; + // } + // }); + // + // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); + // if (model.state == ViewState.ErrorLocal) { + // Utils.showErrorToast(model.error); + // } else { + // onPick(); + // AppToast.showSuccessToast(message: "Address Added Successfully"); + // } + // Navigator.of(context).pop(); + // }, + // label: TranslationBase.of(context).addNewAddress, + // ), + // ], + // ), + // ), + // ); + // }, + // initialPosition: gmaps.LatLng(latitude, longitude), + // useCurrentLocation: showCurrentLocation, + // ), ), ); } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index d75aecaa..ec5a38c9 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,14 +20,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as gmaps; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; import 'new_cmc_step_three_page.dart'; class NewCMCStepTowPage extends StatefulWidget { - final Function(PickResult) onPick; + final Function() onPick; final double latitude; final double longitude; final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart index b9eefe08..1e8da40c 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -367,11 +367,11 @@ class _EReferralConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index 1ac2f90d..3b4ad131 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,12 +23,11 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class LocationPage extends StatefulWidget { - final Function(PickResult)? onPick; + final Function()? onPick; // final double latitude; // final double longitude; @@ -59,12 +58,12 @@ class _LocationPageState extends State { // Completer mapController = Completer(); late Placemark selectedPlace; - late HmsApiAvailability hmsApiAvailability; + // late HmsApiAvailability hmsApiAvailability; late ProjectViewModel projectViewModel; @override void initState() { - hmsApiAvailability = HmsApiAvailability(); + // hmsApiAvailability = HmsApiAvailability(); if (latitude == 0.0 && longitude == 0.0) { showCurrentLocation = true; } @@ -161,74 +160,7 @@ class _LocationPageState extends State { ), ], ) - : PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onMapCreated: (GoogleMapController controller) { - mapController = controller; - }, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - }, - selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(0.0), - child: state == SearchingState.Searching - ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer - : DefaultButton(TranslationBase.of(context).addNewAddress, () async { - AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( - customer: Customer(addresses: [ - Addresses( - address1: selectedPlace!.formattedAddress, - address2: selectedPlace!.formattedAddress, - customerAttributes: "", - createdOnUtc: "", - id: "0", - faxNumber: "", - phoneNumber: projectViewModel.user!.mobileNumber, - countryId: 69, - latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(), - email: projectViewModel.user!.emailAddress) - ]), - ); - - selectedPlace.addressComponents!.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer!.addresses![0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer!.addresses![0].city = e.longName; - } - }); - - await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast(message: "Address Added Successfully"); - } - Navigator.of(context).pop(addNewAddressRequestModel); - }).insideContainer); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: showCurrentLocation, - ), + : SizedBox() ), ); } @@ -237,11 +169,11 @@ class _LocationPageState extends State { // isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable; // print(isHuawei); // setState(() {}); - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); } void _getUserLocation() async { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 14085fd9..ef438ff2 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { @@ -28,7 +27,7 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget { } class _NewHomeHealthCareStepOnePageState extends State { - late PickResult _result; + // late PickResult _result; @override void initState() { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index dfccb11b..67cf8b16 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -22,12 +22,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'location_page.dart'; class NewHomeHealthCareStepTowPage extends StatefulWidget { - final Function(PickResult)? onPick; + final Function()? onPick; final double? latitude; final double? longitude; final PatientERInsertPresOrderRequestModel? diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart index 89091886..04088c62 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -59,7 +59,7 @@ class HomeHealthCareIndexPage extends StatelessWidget { ), ), label: TranslationBase.of(context).loginRegister, - textColor: Theme.of(context).backgroundColor), + textColor: Theme.of(context).colorScheme.background), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index df8d3cc8..ed24408e 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -59,7 +59,7 @@ class H2OPageIndexPage extends StatelessWidget { label: "Water Tracker", textColor: Theme .of(context) - .backgroundColor), + .colorScheme.background), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index 1779b127..d6b37553 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -1,34 +1,96 @@ +// import 'dart:async'; +// +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:flutter/material.dart'; +// import 'package:webview_flutter/webview_flutter.dart'; +// +// class MyWebView extends StatelessWidget { +// final String title; +// final String selectedUrl; +// +// final Completer _controller = Completer(); +// +// MyWebView({ +// required this.title, +// required this.selectedUrl, +// }); +// +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: true, +// appBarTitle: title, +// isShowDecPage: false, +// showNewAppBar: true, +// showNewAppBarTitle: true, +// body: WebView( +// initialUrl: selectedUrl, +// javascriptMode: JavascriptMode.unrestricted, +// onWebViewCreated: (WebViewController webViewController) { +// _controller.complete(webViewController); +// }, +// )); +// } +// } + + import 'dart:async'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; -class MyWebView extends StatelessWidget { +class MyWebView extends StatefulWidget { final String title; final String selectedUrl; - final Completer _controller = Completer(); - MyWebView({ required this.title, required this.selectedUrl, }); @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: title, - isShowDecPage: false, - showNewAppBar: true, - showNewAppBarTitle: true, - body: WebView( - initialUrl: selectedUrl, - javascriptMode: JavascriptMode.unrestricted, - onWebViewCreated: (WebViewController webViewController) { - _controller.complete(webViewController); + State createState() => _MyWebViewState(); +} + +class _MyWebViewState extends State { + // final Completer _controller = Completer(); + late final WebViewController _controller; + + @override + void initState() { + super.initState(); + _controller = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..setNavigationDelegate( + NavigationDelegate( + onProgress: (int progress) { + // Update loading bar. + }, + onPageStarted: (String url) {}, + onPageFinished: (String url) {}, + onHttpError: (HttpResponseError error) {}, + onWebResourceError: (WebResourceError error) {}, + onNavigationRequest: (NavigationRequest request) { + if (request.url.startsWith('https://www.youtube.com/')) { + return NavigationDecision.prevent; + } + return NavigationDecision.navigate; }, - )); + ), + ) + ..loadRequest(Uri.parse(widget.selectedUrl)); + } + + @override + Widget build(BuildContext context) { + return AppScaffold(isShowAppBar: true, appBarTitle: widget.title, isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, body: WebViewWidget(controller: _controller) + // WebView( + // initialUrl: widget.selectedUrl, + // javascriptMode: JavascriptMode.unrestricted, + // onWebViewCreated: (WebViewController webViewController) { + // _controller.complete(webViewController); + // }, + ); } } diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 20cfd88f..7d19af7a 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -1,4 +1,3 @@ -import 'dart:js'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index 2be812d6..f516655c 100644 --- a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -350,11 +350,11 @@ class _ConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/pages/Blood/new_text_Field.dart b/lib/pages/Blood/new_text_Field.dart index e6431f1f..87c25834 100644 --- a/lib/pages/Blood/new_text_Field.dart +++ b/lib/pages/Blood/new_text_Field.dart @@ -183,7 +183,7 @@ class _NewTextFieldsState extends State { validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ FilteringTextInputFormatter.digitsOnly, @@ -193,8 +193,8 @@ class _NewTextFieldsState extends State { decoration: InputDecoration( labelText: widget.hintText, labelStyle: TextStyle(color: Colors.black), - errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), + errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.error.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.error.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( diff --git a/lib/pages/InPatientServices/components/inpatient_pending_advance_payment.dart b/lib/pages/InPatientServices/components/inpatient_pending_advance_payment.dart index 82e6ab96..7f9d3456 100644 --- a/lib/pages/InPatientServices/components/inpatient_pending_advance_payment.dart +++ b/lib/pages/InPatientServices/components/inpatient_pending_advance_payment.dart @@ -254,16 +254,16 @@ class _InPatientPendingAdvancePaymentState extends State { List appoButtonsList = []; static bool isHuawei = false; - HmsApiAvailability hmsApiAvailability = HmsApiAvailability(); + // HmsApiAvailability hmsApiAvailability = HmsApiAvailability(); @override void initState() { @@ -479,11 +479,11 @@ class _AppointmentActionsState extends State { checkIsHuawei() async { if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - hmsMap.HuaweiMapInitializer.initializeMap(); - }); - print(isHuawei); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // hmsMap.HuaweiMapInitializer.initializeMap(); + // }); + // print(isHuawei); } } diff --git a/lib/pages/conference/zoom/call_screen.dart b/lib/pages/conference/zoom/call_screen.dart index 2ba0e49e..33320613 100644 --- a/lib/pages/conference/zoom/call_screen.dart +++ b/lib/pages/conference/zoom/call_screen.dart @@ -1,1604 +1,1604 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'package:diplomaticquarterapp/pages/conference/zoom/jwt.dart'; -import 'package:diplomaticquarterapp/pages/conference/zoom/video_view.dart'; -import 'package:events_emitter/events_emitter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_cmd_channel.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_event_listener.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart'; -import 'package:google_fonts/google_fonts.dart'; - -// import '../components/video_view.dart'; -// import '../components/comment_list.dart'; -// import 'intro_screen.dart'; -// import 'join_screen.dart'; - -class CallScreen extends StatefulHookWidget { - const CallScreen({Key? key}) : super(key: key); - - @override - State createState() => _CallScreenState(); -} - -class _CallScreenState extends State { - static TextEditingController changeNameController = TextEditingController(); - double opacityLevel = 1.0; - - String currentCameraDeviceId = "1"; - - void _changeOpacity() { - setState(() => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0); - } - - @override - Widget build(BuildContext context) { - var zoom = ZoomVideoSdk(); - var eventListener = ZoomVideoSdkEventListener(); - var isInSession = useState(false); - var sessionName = useState(''); - var sessionPassword = useState(''); - var users = useState([]); - var fullScreenUser = useState(null); - var sharingUser = useState(null); - var videoInfo = useState(''); - var isSharing = useState(false); - var isMuted = useState(false); - var isVideoOn = useState(false); - var isSpeakerOn = useState(false); - var isRenameModalVisible = useState(false); - var isRecordingStarted = useState(false); - var isMicOriginalOn = useState(false); - var isMounted = useIsMounted(); - var audioStatusFlag = useState(false); - var videoStatusFlag = useState(false); - var userNameFlag = useState(false); - var userShareStatusFlag = useState(false); - var isReceiveSpokenLanguageContentEnabled = useState(false); - var isVideoMirrored = useState(false); - var isOriginalAspectRatio = useState(false); - - //hide status bar - SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); - var circleButtonSize = 65.0; - Color backgroundColor = const Color(0xFF232323); - Color buttonBackgroundColor = const Color.fromRGBO(0, 0, 0, 0.6); - Color chatTextColor = const Color(0xFFAAAAAA); - Widget moreOptions; - final args = ModalRoute.of(context)!.settings.arguments as CallArguments; - - useEffect(() { - Future.microtask(() async { - var token = generateJwt(args.sessionName, args.role); - try { - Map SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false}; - Map SDKvideoOptions = { - "localVideoOn": true, - }; - JoinSessionConfig joinSession = JoinSessionConfig( - sessionName: args.sessionName, - sessionPassword: args.sessionPwd, - token: token, - userName: args.displayName, - audioOptions: SDKaudioOptions, - videoOptions: SDKvideoOptions, - sessionIdleTimeoutMins: int.parse(args.sessionIdleTimeoutMins), - ); - await zoom.joinSession(joinSession); - } catch (e) { - print(e); - const AlertDialog( - title: Text("Error"), - content: Text("Failed to join the session"), - ); - Future.delayed(const Duration(milliseconds: 1000)).asStream().listen((event) { - Navigator.pop(context); - // Navigator.popAndPushNamed( - // context, - // "Join", - // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - // ); - }); - } - }); - return null; - }, []); - - useEffect(() { - updateVideoInfo() { - Timer timer = Timer.periodic(const Duration(milliseconds: 1000), (time) async { - if (!isMounted()) return; - - bool? videoOn = false; - videoOn = await fullScreenUser.value?.videoStatus?.isOn(); - - // Video statistic info doesn't update when there's no remote users - if (fullScreenUser.value == null || (videoOn != null && videoOn == false) || users.value.length < 2) { - time.cancel(); - videoInfo.value = ""; - return; - } - - var fps = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getFps() : await fullScreenUser.value?.videoStatisticInfo?.getFps(); - - var height = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getHeight() : await fullScreenUser.value?.videoStatisticInfo?.getHeight(); - - var width = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getWidth() : await fullScreenUser.value?.videoStatisticInfo?.getWidth(); - - videoInfo.value = ("${width}x$height ${fps}FPS"); - }); - } - - updateVideoInfo(); - return null; - }); - - useEffect(() { - eventListener.addEventListener(); - EventEmitter emitter = eventListener.eventEmitter; - - final sessionJoinListener = emitter.on(EventType.onSessionJoin, (sessionUser) async { - isInSession.value = true; - zoom.session.getSessionName().then((value) => sessionName.value = value!); - sessionPassword.value = await zoom.session.getSessionPassword(); - ZoomVideoSdkUser mySelf = ZoomVideoSdkUser.fromJson(jsonDecode(sessionUser.toString())); - List? remoteUsers = await zoom.session.getRemoteUsers(); - var muted = await mySelf.audioStatus?.isMuted(); - var videoOn = await mySelf.videoStatus?.isOn(); - var speakerOn = await zoom.audioHelper.getSpeakerStatus(); - // fullScreenUser.value = mySelf; - fullScreenUser.value = remoteUsers!.isNotEmpty ? remoteUsers![0] : mySelf; - remoteUsers?.insert(0, mySelf); - users.value = remoteUsers!; - isMuted.value = muted!; - isSpeakerOn.value = speakerOn; - isVideoOn.value = videoOn!; - users.value = remoteUsers; - isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(); - }); - - final sessionLeaveListener = emitter.on(EventType.onSessionLeave, (data) async { - isInSession.value = false; - users.value = []; - fullScreenUser.value = null; - await zoom.leaveSession(false); - Navigator.pop(context); - }); - - final sessionNeedPasswordListener = emitter.on(EventType.onSessionNeedPassword, (data) async { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text('Session Need Password'), - content: const Text('Password is required'), - actions: [ - TextButton( - onPressed: () async => { - // Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), - Navigator.pop(context), - await zoom.leaveSession(false), - }, - child: const Text('OK'), - ), - ], - ), - ); - }); - - final sessionPasswordWrongListener = emitter.on(EventType.onSessionPasswordWrong, (data) async { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text('Session Password Incorrect'), - content: const Text('Password is wrong'), - actions: [ - TextButton( - onPressed: () async => { - // Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), - Navigator.pop(context), - await zoom.leaveSession(false), - }, - child: const Text('OK'), - ), - ], - ), - ); - }); - - final userVideoStatusChangedListener = emitter.on(EventType.onUserVideoStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['changedUsers']) as List; - List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - for (var user in userList) { - { - if (user.userId == mySelf?.userId) { - mySelf?.videoStatus?.isOn().then((on) => isVideoOn.value = on); - } - } - } - videoStatusFlag.value = !videoStatusFlag.value; - }); - - final userAudioStatusChangedListener = emitter.on(EventType.onUserAudioStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['changedUsers']) as List; - List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - for (var user in userList) { - { - if (user.userId == mySelf?.userId) { - mySelf?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); - } - } - } - audioStatusFlag.value = !audioStatusFlag.value; - }); - - final userShareStatusChangeListener = emitter.on(EventType.onUserShareStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); - - if (data['status'] == ShareStatus.Start) { - sharingUser.value = shareUser; - fullScreenUser.value = shareUser; - isSharing.value = (shareUser.userId == mySelf?.userId); - } else { - sharingUser.value = null; - isSharing.value = false; - fullScreenUser.value = mySelf; - } - userShareStatusFlag.value = !userShareStatusFlag.value; - }); - - final userJoinListener = emitter.on(EventType.onUserJoin, (data) async { - if (!isMounted()) return; - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['remoteUsers']) as List; - List remoteUserList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - remoteUserList.insert(0, mySelf!); - users.value = remoteUserList; - fullScreenUser.value = remoteUserList[1]; - }); - - final userLeaveListener = emitter.on(EventType.onUserLeave, (data) async { - if (!isMounted()) return; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - data = data as Map; - var remoteUserListJson = jsonDecode(data['remoteUsers']) as List; - List remoteUserList = remoteUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - var leftUserListJson = jsonDecode(data['leftUsers']) as List; - List leftUserLis = leftUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - if (fullScreenUser.value != null) { - for (var user in leftUserLis) { - { - if (fullScreenUser.value?.userId == user.userId) { - fullScreenUser.value = mySelf; - } - } - } - } else { - fullScreenUser.value = mySelf; - } - remoteUserList.add(mySelf!); - users.value = remoteUserList; - }); - - final userNameChangedListener = emitter.on(EventType.onUserNameChanged, (data) async { - if (!isMounted()) return; - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - int index; - for (var user in users.value) { - if (user.userId == changedUser.userId) { - index = users.value.indexOf(user); - users.value[index] = changedUser; - } - } - userNameFlag.value = !userNameFlag.value; - }); - - final commandReceived = emitter.on(EventType.onCommandReceived, (data) async { - data = data as Map; - debugPrint("sender: ${ZoomVideoSdkUser.fromJson(jsonDecode(data['sender']))}, command: ${data['command']}"); - }); - - final chatDeleteMessageNotify = emitter.on(EventType.onChatDeleteMessageNotify, (data) async { - data = data as Map; - debugPrint("onChatDeleteMessageNotify: messageID: ${data['msgID']}, deleteBy: ${data['type']}"); - }); - - final liveStreamStatusChangeListener = emitter.on(EventType.onLiveStreamStatusChanged, (data) async { - data = data as Map; - debugPrint("onLiveStreamStatusChanged: status: ${data['status']}"); - }); - - final liveTranscriptionStatusChangeListener = emitter.on(EventType.onLiveTranscriptionStatus, (data) async { - data = data as Map; - debugPrint("onLiveTranscriptionStatus: status: ${data['status']}"); - }); - - final cloudRecordingStatusListener = emitter.on(EventType.onCloudRecordingStatus, (data) async { - data = data as Map; - debugPrint("onCloudRecordingStatus: status: ${data['status']}"); - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (data['status'] == RecordingStatus.Start) { - if (mySelf != null && !mySelf.isHost!) { - await zoom.acceptRecordingConsent(); - // isRecordingStarted.value = true; - // showDialog( - // context: context, - // builder: (BuildContext context) => AlertDialog( - // content: const Text('The session is being recorded.'), - // actions: [ - // TextButton( - // onPressed: () async { - // await zoom.acceptRecordingConsent(); - // // if (context.mounted) { - // Navigator.pop(context); - // // }; - // }, - // child: const Text('accept'), - // ), - // TextButton( - // onPressed: () async { - // String currentConsentType = await zoom.getRecordingConsentType(); - // if (currentConsentType == ConsentType.ConsentType_Individual) { - // await zoom.declineRecordingConsent(); - // Navigator.pop(context); - // } else { - // await zoom.declineRecordingConsent(); - // zoom.leaveSession(false); - // // if (!context.mounted) return; - // // Navigator.popAndPushNamed( - // // context, - // // "Join", - // // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - // // ); - // Navigator.pop(context); - // } - // }, - // child: const Text('decline'), - // ), - // ], - // ), - // ); - } - isRecordingStarted.value = true; - } else { - isRecordingStarted.value = false; - } - }); - - final liveTranscriptionMsgInfoReceivedListener = emitter.on(EventType.onLiveTranscriptionMsgInfoReceived, (data) async { - data = data as Map; - ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); - debugPrint("onLiveTranscriptionMsgInfoReceived: content: ${messageInfo.messageContent}"); - }); - - final inviteByPhoneStatusListener = emitter.on(EventType.onInviteByPhoneStatus, (data) async { - data = data as Map; - debugPrint("onInviteByPhoneStatus: status: ${data['status']}, reason: ${data['reason']}"); - }); - - final multiCameraStreamStatusChangedListener = emitter.on(EventType.onMultiCameraStreamStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - var status = data['status']; - for (var user in users.value) { - { - if (changedUser.userId == user.userId) { - if (status == MultiCameraStreamStatus.Joined) { - user.hasMultiCamera = true; - } else if (status == MultiCameraStreamStatus.Left) { - user.hasMultiCamera = false; - } - } - } - } - }); - - final requireSystemPermission = emitter.on(EventType.onRequireSystemPermission, (data) async { - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - var permissionType = data['permissionType']; - switch (permissionType) { - case SystemPermissionType.Camera: - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Can't Access Camera"), - content: const Text("please turn on the toggle in system settings to grant permission"), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - break; - case SystemPermissionType.Microphone: - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Can't Access Microphone"), - content: const Text("please turn on the toggle in system settings to grant permission"), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - break; - } - }); - - final networkStatusChangeListener = emitter.on(EventType.onUserVideoNetworkStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? networkUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); - - if (data['status'] == NetworkStatus.Bad) { - debugPrint("onUserVideoNetworkStatusChanged: status: ${data['status']}, user: ${networkUser.userName}"); - } - }); - - final eventErrorListener = emitter.on( - EventType.onError, - (data) async { - data = data as Map; - String errorType = data['errorType']; - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: Text(errorType), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconncting) { - Timer( - const Duration(milliseconds: 1000), - () => Navigator.pop(context), - // Navigator.popAndPushNamed( - // context, - // "Join", - // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - // ), - ); - } - }, - ); - - final userRecordingConsentListener = emitter.on(EventType.onUserRecordingConsent, (data) async { - data = data as Map; - ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); - debugPrint('userRecordingConsentListener: user= ${user.userName}'); - }); - - final callCRCDeviceStatusListener = emitter.on(EventType.onCallCRCDeviceStatusChanged, (data) async { - data = data as Map; - debugPrint('onCallCRCDeviceStatusChanged: status = ${data['status']}'); - }); - - final originalLanguageMsgReceivedListener = emitter.on(EventType.onOriginalLanguageMsgReceived, (data) async { - data = data as Map; - ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); - debugPrint("onOriginalLanguageMsgReceived: content: ${messageInfo.messageContent}"); - }); - - final chatPrivilegeChangedListener = emitter.on(EventType.onChatPrivilegeChanged, (data) async { - data = data as Map; - String type = data['privilege']; - debugPrint('chatPrivilegeChangedListener: type= $type'); - }); - - return () => { - sessionJoinListener.cancel(), - sessionLeaveListener.cancel(), - sessionPasswordWrongListener.cancel(), - sessionNeedPasswordListener.cancel(), - userVideoStatusChangedListener.cancel(), - userAudioStatusChangedListener.cancel(), - userJoinListener.cancel(), - userLeaveListener.cancel(), - userNameChangedListener.cancel(), - userShareStatusChangeListener.cancel(), - liveStreamStatusChangeListener.cancel(), - cloudRecordingStatusListener.cancel(), - inviteByPhoneStatusListener.cancel(), - eventErrorListener.cancel(), - commandReceived.cancel(), - chatDeleteMessageNotify.cancel(), - liveTranscriptionStatusChangeListener.cancel(), - liveTranscriptionMsgInfoReceivedListener.cancel(), - multiCameraStreamStatusChangedListener.cancel(), - requireSystemPermission.cancel(), - userRecordingConsentListener.cancel(), - networkStatusChangeListener.cancel(), - callCRCDeviceStatusListener.cancel(), - originalLanguageMsgReceivedListener.cancel(), - chatPrivilegeChangedListener.cancel(), - }; - }, [zoom, users.value, isMounted]); - - void onPressAudio() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (mySelf != null) { - final audioStatus = mySelf.audioStatus; - if (audioStatus != null) { - var muted = await audioStatus.isMuted(); - if (muted) { - await zoom.audioHelper.unMuteAudio(mySelf.userId); - } else { - await zoom.audioHelper.muteAudio(mySelf.userId); - } - } - } - } - - void onPressCameraChange() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (mySelf != null) { - final videoStatus = mySelf.videoStatus; - if (videoStatus != null) { - if (currentCameraDeviceId == "1") { - currentCameraDeviceId = "2"; - await zoom.videoHelper.switchCamera("2"); - } else { - currentCameraDeviceId = "1"; - await zoom.videoHelper.switchCamera("1"); - } - } - } - } - - void onPressVideo() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (mySelf != null) { - final videoStatus = mySelf.videoStatus; - if (videoStatus != null) { - var videoOn = await videoStatus.isOn(); - if (videoOn) { - await zoom.videoHelper.stopVideo(); - } else { - await zoom.videoHelper.startVideo(); - } - } - } - } - - void onPressShare() async { - var isOtherSharing = await zoom.shareHelper.isOtherSharing(); - var isShareLocked = await zoom.shareHelper.isShareLocked(); - - if (isOtherSharing) { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: const Text('Other is sharing'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - } else if (isShareLocked) { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: const Text('Share is locked by host'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - } else if (isSharing.value) { - zoom.shareHelper.stopShare(); - } else { - zoom.shareHelper.shareScreen(); - } - } - - moreOptions = Center( - child: Stack( - children: [ - Visibility( - visible: isRenameModalVisible.value, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - alignment: Alignment.bottomLeft, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - ), - width: MediaQuery.of(context).size.width - 130, - height: 130, - child: Center( - child: (Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 20, left: 20), - child: Text( - 'Change Name', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ), - ), - Padding( - padding: const EdgeInsets.only(top: 10, left: 20), - child: SizedBox( - width: MediaQuery.of(context).size.width - 230, - child: TextField( - onEditingComplete: () {}, - autofocus: true, - cursorColor: Colors.black, - controller: changeNameController, - decoration: InputDecoration( - isDense: true, - hintText: 'New name', - hintStyle: TextStyle( - fontSize: 14.0, - color: chatTextColor, - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsets.only(top: 15), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(left: 40), - child: InkWell( - child: Text( - 'Apply', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 16, - ), - ), - ), - onTap: () async { - if (fullScreenUser.value != null) { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - await zoom.userHelper.changeName((mySelf?.userId)!, changeNameController.text); - changeNameController.clear(); - } - isRenameModalVisible.value = false; - }, - ), - ), - Padding( - padding: const EdgeInsets.only(left: 40), - child: InkWell( - child: Text( - 'Cancel', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 16, - ), - ), - ), - onTap: () async { - isRenameModalVisible.value = false; - }, - ), - ) - ], - ), - ) - ], - )), - ), - ), - ], - )), - ], - ), - ); - - void onSelectedUserVolume(ZoomVideoSdkUser user) async { - var isShareAudio = user.isSharing; - bool canSetVolume = await user.canSetUserVolume(user.userId, isShareAudio); - num userVolume; - - List options = [ - ListTile( - title: Text( - 'Adjust Volume', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - ), - ), - ListTile( - title: Text( - 'Current volume', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint('user volume'), - userVolume = await user.getUserVolume(user.userId, isShareAudio), - debugPrint('user ${user.userName}\'s volume is ${userVolume!}'), - }, - ), - ]; - if (canSetVolume) { - options.add( - ListTile( - title: Text( - 'Volume up', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - userVolume = await user.getUserVolume(user.userId, isShareAudio), - if (userVolume < 10) - { - await user.setUserVolume(user.userId, userVolume + 1, isShareAudio), - } - else - { - debugPrint("Cannot volume up."), - } - }, - ), - ); - options.add( - ListTile( - title: Text( - 'Volume down', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - userVolume = await user.getUserVolume(user.userId, isShareAudio), - if (userVolume > 0) - { - await user.setUserVolume(user.userId, userVolume - 1, isShareAudio), - } - else - { - debugPrint("Cannot volume down."), - } - }, - ), - ); - } - showDialog( - context: context, - builder: (context) { - return Dialog( - elevation: 0.0, - insetPadding: const EdgeInsets.symmetric(horizontal: 40), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - height: options.length * 58, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListView( - shrinkWrap: true, - children: ListTile.divideTiles( - context: context, - tiles: options, - ).toList(), - ), - ], - ), - )); - }); - } - - Future onPressMore() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - bool isShareLocked = await zoom.shareHelper.isShareLocked(); - bool canSwitchSpeaker = await zoom.audioHelper.canSwitchSpeaker(); - bool canStartRecording = (await zoom.recordingHelper.canStartRecording()) == Errors.Success; - var startLiveTranscription = (await zoom.liveTranscriptionHelper.getLiveTranscriptionStatus()) == LiveTranscriptionStatus.Start; - bool canStartLiveTranscription = await zoom.liveTranscriptionHelper.canStartLiveTranscription(); - bool canStartLiveStream = await zoom.liveStreamHelper.canStartLiveStream() == Errors.Success; - debugPrint(await zoom.liveStreamHelper.canStartLiveStream()); - bool startLiveStream = false; - bool isHost = (mySelf != null) ? (await mySelf.getIsHost()) : false; - isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(); - bool canCallOutToCRC = await zoom.CRCHelper.isCRCEnabled(); - - List options = [ - ListTile( - title: Text( - 'More', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - ), - ), - ListTile( - title: Text( - 'is Support Virtual Background', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint("${await zoom.virtualBackgroundHelper.isSupportVirtualBackground()}"), - Navigator.of(context).pop(), - }, - ), - ListTile( - title: Text( - 'Get Chat Privilege', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint("Chat Privilege = ${await zoom.chatHelper.getChatPrivilege()}"), - Navigator.of(context).pop(), - }, - ), - ListTile( - title: Text( - 'Get Session Dial-in Number infos', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint("session number = ${await zoom.session.getSessionNumber()}"), - Navigator.of(context).pop(), - }, - ), - ListTile( - title: Text( - '${isMicOriginalOn.value ? 'Disable' : 'Enable'} Original Sound', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint("${isMicOriginalOn.value}"), - await zoom.audioSettingHelper.enableMicOriginalInput(!isMicOriginalOn.value), - isMicOriginalOn.value = await zoom.audioSettingHelper.isMicOriginalInputEnable(), - debugPrint("Original sound ${isMicOriginalOn.value ? 'Enabled' : 'Disabled'}"), - Navigator.of(context).pop(), - }, - ) - ]; - - if (canCallOutToCRC) { - options.add(ListTile( - title: Text( - 'Call-out to CRC devices', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint('CRC result = ${await zoom.CRCHelper.callCRCDevice("bjn.vc", ZoomVideoSdkCRCProtocolType.SIP)}'), - Navigator.of(context).pop(), - }, - )); - options.add(ListTile( - title: Text( - 'Cancel call-out to CRC devices', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint('cancel result= ${await zoom.CRCHelper.cancelCallCRCDevice()}'), - Navigator.of(context).pop(), - }, - )); - } - - if (canSwitchSpeaker) { - options.add(ListTile( - title: Text( - 'Turn ${isSpeakerOn.value ? 'off' : 'on'} Speaker', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - await zoom.audioHelper.setSpeaker(!isSpeakerOn.value), - isSpeakerOn.value = await zoom.audioHelper.getSpeakerStatus(), - debugPrint('Turned ${isSpeakerOn.value ? 'on' : 'off'} Speaker'), - Navigator.of(context).pop(), - }, - )); - } - - if (isHost) { - options.add(ListTile( - title: Text( - '${isShareLocked ? 'Unlock' : 'Lock'} Share', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - debugPrint("isShareLocked = ${await zoom.shareHelper.lockShare(!isShareLocked)}"), - Navigator.of(context).pop(), - })); - options.add(ListTile( - title: Text( - 'Change Name', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () => { - isRenameModalVisible.value = true, - Navigator.of(context).pop(), - }, - )); - } - - if (canStartLiveTranscription) { - options.add(ListTile( - title: Text( - "${startLiveTranscription ? 'Stop' : 'Start'} Live Transcription", - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - if (startLiveTranscription) - { - debugPrint('stopLiveTranscription= ${await zoom.liveTranscriptionHelper.stopLiveTranscription()}'), - } - else - { - debugPrint('startLiveTranscription= ${await zoom.liveTranscriptionHelper.startLiveTranscription()}'), - }, - Navigator.of(context).pop(), - }, - )); - options.add(ListTile( - title: Text( - '${isReceiveSpokenLanguageContentEnabled.value ? 'Disable' : 'Enable'} receiving original caption', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - await zoom.liveTranscriptionHelper.enableReceiveSpokenLanguageContent(!isReceiveSpokenLanguageContentEnabled.value), - isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(), - debugPrint("isReceiveSpokenLanguageContentEnabled = ${isReceiveSpokenLanguageContentEnabled.value}"), - Navigator.of(context).pop(), - })); - } - - if (canStartRecording) { - options.add(ListTile( - title: Text( - '${isRecordingStarted.value ? 'Stop' : 'Start'} Recording', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - if (!isRecordingStarted.value) - { - debugPrint('isRecordingStarted = ${await zoom.recordingHelper.startCloudRecording()}'), - } - else - { - debugPrint('isRecordingStarted = ${await zoom.recordingHelper.stopCloudRecording()}'), - }, - Navigator.of(context).pop(), - })); - } - - if (isVideoOn.value) { - options.add(ListTile( - title: Text( - 'Mirror the video', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - await zoom.videoHelper.mirrorMyVideo(!isVideoMirrored.value), - isVideoMirrored.value = await zoom.videoHelper.isMyVideoMirrored(), - Navigator.of(context).pop(), - })); - options.add(ListTile( - title: Text( - '${isOriginalAspectRatio.value ? 'Enable' : 'Disable'} original aspect ratio', - style: GoogleFonts.lato( - textStyle: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - ), - onTap: () async => { - await zoom.videoHelper.enableOriginalAspectRatio(!isOriginalAspectRatio.value), - isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(), - debugPrint("isOriginalAspectRatio= ${isOriginalAspectRatio.value}"), - Navigator.of(context).pop(), - })); - } - showDialog( - context: context, - builder: (context) { - return Dialog( - elevation: 0.0, - insetPadding: const EdgeInsets.symmetric(horizontal: 40), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - height: 500, - child: Scrollbar( - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: ListTile.divideTiles( - context: context, - tiles: options, - ).toList(), - ), - ), - ), - ); - }); - } - - void onLeaveSession(bool isEndSession) async { - await zoom.leaveSession(isEndSession); - Navigator.pop(context); - // Navigator.pop(context); - } - - void showLeaveOptions() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - bool isHost = await mySelf!.getIsHost(); - - onLeaveSession(true); - - // Widget endSession; - // Widget leaveSession; - // Widget cancel = TextButton( - // child: const Text('Cancel'), - // onPressed: () { - // Navigator.pop(context); //close Dialog - // }, - // ); - - // switch (defaultTargetPlatform) { - // case TargetPlatform.android: - // endSession = TextButton( - // child: const Text('End Session'), - // onPressed: () => onLeaveSession(true), - // ); - // leaveSession = TextButton( - // child: const Text('Leave Session'), - // onPressed: () => onLeaveSession(false), - // ); - // break; - // default: - // endSession = CupertinoActionSheetAction( - // isDestructiveAction: true, - // child: const Text('End Session'), - // onPressed: () => onLeaveSession(true), - // ); - // leaveSession = CupertinoActionSheetAction( - // child: const Text('Leave Session'), - // onPressed: () => onLeaveSession(false), - // ); - // break; - // } - // - // List options = [ - // leaveSession, - // cancel, - // ]; - // - // if (Platform.isAndroid) { - // if (isHost) { - // options.removeAt(1); - // options.insert(0, endSession); - // } - // showDialog( - // context: context, - // builder: (context) { - // return AlertDialog( - // content: const Text("Do you want to leave this session?"), - // shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))), - // actions: options, - // ); - // }); - // } else { - // options.removeAt(1); - // if (isHost) { - // options.insert(1, endSession); - // } - // showCupertinoModalPopup( - // context: context, - // builder: (context) => CupertinoActionSheet( - // message: const Text('Are you sure that you want to leave the call?'), - // actions: options, - // cancelButton: cancel, - // ), - // ); - // } - } - - final chatMessageController = TextEditingController(); - - void sendChatMessage(String message) async { - await zoom.chatHelper.sendChatToAll(message); - ZoomVideoSdkUser? self = await zoom.session.getMySelf(); - ZoomVideoSdkCmdChannel cmdChannel = zoom.cmdChannel; - for (var user in users.value) { - if (user.userId != self?.userId) { - await zoom.cmdChannel.sendCommand(user.userId, message); - } - } - chatMessageController.clear(); - // send the chat as a command - } - - void onSelectedUser(ZoomVideoSdkUser user) async { - setState(() { - fullScreenUser.value = user; - }); - } - - Widget fullScreenView; - Widget smallView; - - if (isInSession.value && fullScreenUser.value != null && users.value.isNotEmpty) { - fullScreenView = AnimatedOpacity( - opacity: opacityLevel, - duration: const Duration(seconds: 3), - child: VideoView( - user: fullScreenUser.value, - hasMultiCamera: false, - sharing: sharingUser.value == null ? false : (sharingUser.value?.userId == fullScreenUser.value?.userId), - preview: false, - focused: false, - multiCameraIndex: "0", - videoAspect: VideoAspect.Original, - fullScreen: true, - resolution: VideoResolution.Resolution360, - isPiPView: false, - ), - ); - - smallView = Container( - height: 110, - margin: const EdgeInsets.only(left: 20, right: 20), - alignment: Alignment.bottomLeft, - child: VideoView( - user: users.value[0], - hasMultiCamera: false, - sharing: sharingUser.value == null ? false : sharingUser.value?.userId == users.value[0].userId, - preview: false, - focused: false, - multiCameraIndex: "0", - videoAspect: VideoAspect.Original, - fullScreen: false, - resolution: VideoResolution.Resolution180, - isPiPView: false, - ), - - // ListView.separated( - // scrollDirection: Axis.horizontal, - // itemCount: users.value.length, - // itemBuilder: (BuildContext context, int index) { - // return InkWell( - // onTap: () async { - // onSelectedUser(users.value[index]); - // }, - // onDoubleTap: () async { - // onSelectedUserVolume(users.value[index]); - // }, - // child: Center( - // child: VideoView( - // user: users.value[index], - // hasMultiCamera: false, - // sharing: sharingUser.value == null ? false : sharingUser.value?.userId == users.value[index].userId, - // preview: false, - // focused: false, - // multiCameraIndex: "0", - // videoAspect: VideoAspect.Original, - // fullScreen: false, - // resolution: VideoResolution.Resolution180, - // isPiPView: false, - // ), - // ), - // ); - // }, - // separatorBuilder: (BuildContext context, int index) => const Divider(), - // ), - ); - } else { - fullScreenView = Container( - color: Colors.black, - child: const Center( - child: Text( - "Connecting...", - style: TextStyle( - fontSize: 20, - color: Colors.white, - ), - ), - )); - smallView = Container( - height: 110, - color: Colors.transparent, - ); - } - - _changeOpacity; - return Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: backgroundColor, - body: Stack( - children: [ - fullScreenView, - Container( - padding: const EdgeInsets.only(top: 35), - child: Stack( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Container( - // height: 70, - // width: 150, - // margin: const EdgeInsets.only(top: 16, left: 8), - // padding: const EdgeInsets.all(8), - // alignment: Alignment.topLeft, - // decoration: BoxDecoration( - // borderRadius: const BorderRadius.all(Radius.circular(8.0)), - // color: buttonBackgroundColor, - // ), - // child: InkWell( - // onTap: () async { - // showDialog( - // context: context, - // builder: (context) { - // return Dialog( - // elevation: 0.0, - // insetPadding: const EdgeInsets.symmetric(horizontal: 40), - // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - // child: SizedBox( - // height: 280, - // width: 200, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.stretch, - // children: [ - // ListView( - // shrinkWrap: true, - // children: ListTile.divideTiles( - // context: context, - // tiles: [ - // ListTile( - // title: Text( - // 'Session Information', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 18, - // fontWeight: FontWeight.w600, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Session Name', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // sessionName.value, - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Session Password', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // sessionPassword.value, - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Participants', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // '${users.value.length}', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ], - // ).toList(), - // ), - // ], - // ), - // )); - // }); - // }, - // child: Stack( - // children: [ - // // Column( - // // children: [ - // // const Padding(padding: EdgeInsets.symmetric(vertical: 3)), - // // Align( - // // alignment: Alignment.centerLeft, - // // child: Text( - // // sessionName.value, - // // overflow: TextOverflow.ellipsis, - // // style: GoogleFonts.lato( - // // textStyle: const TextStyle( - // // fontSize: 14, - // // fontWeight: FontWeight.w600, - // // color: Colors.white, - // // ), - // // ), - // // ), - // // ), - // // const Padding(padding: EdgeInsets.symmetric(vertical: 5)), - // // Align( - // // alignment: Alignment.centerLeft, - // // child: Text( - // // "Participants: ${users.value.length}", - // // style: GoogleFonts.lato( - // // textStyle: const TextStyle( - // // fontSize: 14, - // // fontWeight: FontWeight.w600, - // // color: Colors.white, - // // ), - // // ), - // // ), - // // ) - // // ], - // // ), - // // Container( - // // alignment: Alignment.centerRight, - // // child: Image.asset( - // // "assets/icons/unlocked@2x.png", - // // height: 22, - // // )), - // ], - // ), - // ), - // ), - TextButton( - onPressed: (showLeaveOptions), - child: Container( - alignment: Alignment.topRight, - margin: const EdgeInsets.only(top: 16, right: 8), - padding: const EdgeInsets.only(top: 5, bottom: 5, left: 16, right: 16), - height: 28, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(20.0)), - color: buttonBackgroundColor, - ), - child: const Text( - "LEAVE", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xFFE02828), - ), - ), - )), - ], - ), - Align( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - IconButton( - onPressed: onPressAudio, - icon: isMuted.value ? Image.asset("assets/images/new/zoom/unmute@2x.png") : Image.asset("assets/images/new/zoom/mute@2x.png"), - iconSize: circleButtonSize, - tooltip: isMuted.value == true ? "Unmute" : "Mute", - ), - // IconButton( - // onPressed: onPressShare, - // icon: isSharing.value ? Image.asset("assets/images/new/zoom/share-off@2x.png") : Image.asset("assets/images/new/zoom/share-on@2x.png"), - // iconSize: circleButtonSize, - // ), - IconButton( - onPressed: onPressVideo, - iconSize: circleButtonSize, - icon: isVideoOn.value ? Image.asset("assets/images/new/zoom/video-off@2x.png") : Image.asset("assets/images/new/zoom/video-on@2x.png"), - ), - IconButton( - onPressed: onPressCameraChange, - iconSize: circleButtonSize, - icon: const Icon( - Icons.cameraswitch_sharp, - size: 45.0, - color: Colors.white, - ), - ), - // IconButton( - // onPressed: onPressMore, - // icon: Image.asset("assets/icons/more@2x.png"), - // iconSize: circleButtonSize, - // ), - ], - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(bottom: 120), - child: smallView, - ), - // CommentList(zoom: zoom, eventListener: eventListener), - moreOptions, - ], - )), - ], - ) - // drawer: const MenuBar() - ); - } -} - -class CallArguments { - final bool isJoin; - final String sessionName; - final String sessionPwd; - final String displayName; - final String sessionIdleTimeoutMins; - final String role; - - CallArguments(this.sessionName, this.sessionPwd, this.displayName, this.sessionIdleTimeoutMins, this.role, this.isJoin); -} - -class JoinArguments { - final bool isJoin; - final String sessionName; - final String sessionPwd; - final String displayName; - final String sessionTimeout; - final String roleType; - - JoinArguments(this.isJoin, this.sessionName, this.sessionPwd, this.displayName, this.sessionTimeout, this.roleType); -} +// import 'dart:async'; +// import 'dart:convert'; +// import 'dart:io'; +// import 'package:diplomaticquarterapp/pages/conference/zoom/jwt.dart'; +// import 'package:diplomaticquarterapp/pages/conference/zoom/video_view.dart'; +// import 'package:events_emitter/events_emitter.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/foundation.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_cmd_channel.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_event_listener.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart'; +// import 'package:google_fonts/google_fonts.dart'; +// +// // import '../components/video_view.dart'; +// // import '../components/comment_list.dart'; +// // import 'intro_screen.dart'; +// // import 'join_screen.dart'; +// +// class CallScreen extends StatefulHookWidget { +// const CallScreen({Key? key}) : super(key: key); +// +// @override +// State createState() => _CallScreenState(); +// } +// +// class _CallScreenState extends State { +// static TextEditingController changeNameController = TextEditingController(); +// double opacityLevel = 1.0; +// +// String currentCameraDeviceId = "1"; +// +// void _changeOpacity() { +// setState(() => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0); +// } +// +// @override +// Widget build(BuildContext context) { +// var zoom = ZoomVideoSdk(); +// var eventListener = ZoomVideoSdkEventListener(); +// var isInSession = useState(false); +// var sessionName = useState(''); +// var sessionPassword = useState(''); +// var users = useState([]); +// var fullScreenUser = useState(null); +// var sharingUser = useState(null); +// var videoInfo = useState(''); +// var isSharing = useState(false); +// var isMuted = useState(false); +// var isVideoOn = useState(false); +// var isSpeakerOn = useState(false); +// var isRenameModalVisible = useState(false); +// var isRecordingStarted = useState(false); +// var isMicOriginalOn = useState(false); +// var isMounted = useIsMounted(); +// var audioStatusFlag = useState(false); +// var videoStatusFlag = useState(false); +// var userNameFlag = useState(false); +// var userShareStatusFlag = useState(false); +// var isReceiveSpokenLanguageContentEnabled = useState(false); +// var isVideoMirrored = useState(false); +// var isOriginalAspectRatio = useState(false); +// +// //hide status bar +// SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); +// var circleButtonSize = 65.0; +// Color backgroundColor = const Color(0xFF232323); +// Color buttonBackgroundColor = const Color.fromRGBO(0, 0, 0, 0.6); +// Color chatTextColor = const Color(0xFFAAAAAA); +// Widget moreOptions; +// final args = ModalRoute.of(context)!.settings.arguments as CallArguments; +// +// useEffect(() { +// Future.microtask(() async { +// var token = generateJwt(args.sessionName, args.role); +// try { +// Map SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false}; +// Map SDKvideoOptions = { +// "localVideoOn": true, +// }; +// JoinSessionConfig joinSession = JoinSessionConfig( +// sessionName: args.sessionName, +// sessionPassword: args.sessionPwd, +// token: token, +// userName: args.displayName, +// audioOptions: SDKaudioOptions, +// videoOptions: SDKvideoOptions, +// sessionIdleTimeoutMins: int.parse(args.sessionIdleTimeoutMins), +// ); +// await zoom.joinSession(joinSession); +// } catch (e) { +// print(e); +// const AlertDialog( +// title: Text("Error"), +// content: Text("Failed to join the session"), +// ); +// Future.delayed(const Duration(milliseconds: 1000)).asStream().listen((event) { +// Navigator.pop(context); +// // Navigator.popAndPushNamed( +// // context, +// // "Join", +// // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// // ); +// }); +// } +// }); +// return null; +// }, []); +// +// useEffect(() { +// updateVideoInfo() { +// Timer timer = Timer.periodic(const Duration(milliseconds: 1000), (time) async { +// if (!isMounted()) return; +// +// bool? videoOn = false; +// videoOn = await fullScreenUser.value?.videoStatus?.isOn(); +// +// // Video statistic info doesn't update when there's no remote users +// if (fullScreenUser.value == null || (videoOn != null && videoOn == false) || users.value.length < 2) { +// time.cancel(); +// videoInfo.value = ""; +// return; +// } +// +// var fps = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getFps() : await fullScreenUser.value?.videoStatisticInfo?.getFps(); +// +// var height = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getHeight() : await fullScreenUser.value?.videoStatisticInfo?.getHeight(); +// +// var width = isSharing.value ? await fullScreenUser.value?.shareStatisticInfo?.getWidth() : await fullScreenUser.value?.videoStatisticInfo?.getWidth(); +// +// videoInfo.value = ("${width}x$height ${fps}FPS"); +// }); +// } +// +// updateVideoInfo(); +// return null; +// }); +// +// useEffect(() { +// eventListener.addEventListener(); +// EventEmitter emitter = eventListener.eventEmitter; +// +// final sessionJoinListener = emitter.on(EventType.onSessionJoin, (sessionUser) async { +// isInSession.value = true; +// zoom.session.getSessionName().then((value) => sessionName.value = value!); +// sessionPassword.value = await zoom.session.getSessionPassword(); +// ZoomVideoSdkUser mySelf = ZoomVideoSdkUser.fromJson(jsonDecode(sessionUser.toString())); +// List? remoteUsers = await zoom.session.getRemoteUsers(); +// var muted = await mySelf.audioStatus?.isMuted(); +// var videoOn = await mySelf.videoStatus?.isOn(); +// var speakerOn = await zoom.audioHelper.getSpeakerStatus(); +// // fullScreenUser.value = mySelf; +// fullScreenUser.value = remoteUsers!.isNotEmpty ? remoteUsers![0] : mySelf; +// remoteUsers?.insert(0, mySelf); +// users.value = remoteUsers!; +// isMuted.value = muted!; +// isSpeakerOn.value = speakerOn; +// isVideoOn.value = videoOn!; +// users.value = remoteUsers; +// isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(); +// }); +// +// final sessionLeaveListener = emitter.on(EventType.onSessionLeave, (data) async { +// isInSession.value = false; +// users.value = []; +// fullScreenUser.value = null; +// await zoom.leaveSession(false); +// Navigator.pop(context); +// }); +// +// final sessionNeedPasswordListener = emitter.on(EventType.onSessionNeedPassword, (data) async { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text('Session Need Password'), +// content: const Text('Password is required'), +// actions: [ +// TextButton( +// onPressed: () async => { +// // Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), +// Navigator.pop(context), +// await zoom.leaveSession(false), +// }, +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// }); +// +// final sessionPasswordWrongListener = emitter.on(EventType.onSessionPasswordWrong, (data) async { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text('Session Password Incorrect'), +// content: const Text('Password is wrong'), +// actions: [ +// TextButton( +// onPressed: () async => { +// // Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), +// Navigator.pop(context), +// await zoom.leaveSession(false), +// }, +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// }); +// +// final userVideoStatusChangedListener = emitter.on(EventType.onUserVideoStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['changedUsers']) as List; +// List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// for (var user in userList) { +// { +// if (user.userId == mySelf?.userId) { +// mySelf?.videoStatus?.isOn().then((on) => isVideoOn.value = on); +// } +// } +// } +// videoStatusFlag.value = !videoStatusFlag.value; +// }); +// +// final userAudioStatusChangedListener = emitter.on(EventType.onUserAudioStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['changedUsers']) as List; +// List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// for (var user in userList) { +// { +// if (user.userId == mySelf?.userId) { +// mySelf?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); +// } +// } +// } +// audioStatusFlag.value = !audioStatusFlag.value; +// }); +// +// final userShareStatusChangeListener = emitter.on(EventType.onUserShareStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); +// +// if (data['status'] == ShareStatus.Start) { +// sharingUser.value = shareUser; +// fullScreenUser.value = shareUser; +// isSharing.value = (shareUser.userId == mySelf?.userId); +// } else { +// sharingUser.value = null; +// isSharing.value = false; +// fullScreenUser.value = mySelf; +// } +// userShareStatusFlag.value = !userShareStatusFlag.value; +// }); +// +// final userJoinListener = emitter.on(EventType.onUserJoin, (data) async { +// if (!isMounted()) return; +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['remoteUsers']) as List; +// List remoteUserList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// remoteUserList.insert(0, mySelf!); +// users.value = remoteUserList; +// fullScreenUser.value = remoteUserList[1]; +// }); +// +// final userLeaveListener = emitter.on(EventType.onUserLeave, (data) async { +// if (!isMounted()) return; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// data = data as Map; +// var remoteUserListJson = jsonDecode(data['remoteUsers']) as List; +// List remoteUserList = remoteUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// var leftUserListJson = jsonDecode(data['leftUsers']) as List; +// List leftUserLis = leftUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// if (fullScreenUser.value != null) { +// for (var user in leftUserLis) { +// { +// if (fullScreenUser.value?.userId == user.userId) { +// fullScreenUser.value = mySelf; +// } +// } +// } +// } else { +// fullScreenUser.value = mySelf; +// } +// remoteUserList.add(mySelf!); +// users.value = remoteUserList; +// }); +// +// final userNameChangedListener = emitter.on(EventType.onUserNameChanged, (data) async { +// if (!isMounted()) return; +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// int index; +// for (var user in users.value) { +// if (user.userId == changedUser.userId) { +// index = users.value.indexOf(user); +// users.value[index] = changedUser; +// } +// } +// userNameFlag.value = !userNameFlag.value; +// }); +// +// final commandReceived = emitter.on(EventType.onCommandReceived, (data) async { +// data = data as Map; +// debugPrint("sender: ${ZoomVideoSdkUser.fromJson(jsonDecode(data['sender']))}, command: ${data['command']}"); +// }); +// +// final chatDeleteMessageNotify = emitter.on(EventType.onChatDeleteMessageNotify, (data) async { +// data = data as Map; +// debugPrint("onChatDeleteMessageNotify: messageID: ${data['msgID']}, deleteBy: ${data['type']}"); +// }); +// +// final liveStreamStatusChangeListener = emitter.on(EventType.onLiveStreamStatusChanged, (data) async { +// data = data as Map; +// debugPrint("onLiveStreamStatusChanged: status: ${data['status']}"); +// }); +// +// final liveTranscriptionStatusChangeListener = emitter.on(EventType.onLiveTranscriptionStatus, (data) async { +// data = data as Map; +// debugPrint("onLiveTranscriptionStatus: status: ${data['status']}"); +// }); +// +// final cloudRecordingStatusListener = emitter.on(EventType.onCloudRecordingStatus, (data) async { +// data = data as Map; +// debugPrint("onCloudRecordingStatus: status: ${data['status']}"); +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (data['status'] == RecordingStatus.Start) { +// if (mySelf != null && !mySelf.isHost!) { +// await zoom.acceptRecordingConsent(); +// // isRecordingStarted.value = true; +// // showDialog( +// // context: context, +// // builder: (BuildContext context) => AlertDialog( +// // content: const Text('The session is being recorded.'), +// // actions: [ +// // TextButton( +// // onPressed: () async { +// // await zoom.acceptRecordingConsent(); +// // // if (context.mounted) { +// // Navigator.pop(context); +// // // }; +// // }, +// // child: const Text('accept'), +// // ), +// // TextButton( +// // onPressed: () async { +// // String currentConsentType = await zoom.getRecordingConsentType(); +// // if (currentConsentType == ConsentType.ConsentType_Individual) { +// // await zoom.declineRecordingConsent(); +// // Navigator.pop(context); +// // } else { +// // await zoom.declineRecordingConsent(); +// // zoom.leaveSession(false); +// // // if (!context.mounted) return; +// // // Navigator.popAndPushNamed( +// // // context, +// // // "Join", +// // // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// // // ); +// // Navigator.pop(context); +// // } +// // }, +// // child: const Text('decline'), +// // ), +// // ], +// // ), +// // ); +// } +// isRecordingStarted.value = true; +// } else { +// isRecordingStarted.value = false; +// } +// }); +// +// final liveTranscriptionMsgInfoReceivedListener = emitter.on(EventType.onLiveTranscriptionMsgInfoReceived, (data) async { +// data = data as Map; +// ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); +// debugPrint("onLiveTranscriptionMsgInfoReceived: content: ${messageInfo.messageContent}"); +// }); +// +// final inviteByPhoneStatusListener = emitter.on(EventType.onInviteByPhoneStatus, (data) async { +// data = data as Map; +// debugPrint("onInviteByPhoneStatus: status: ${data['status']}, reason: ${data['reason']}"); +// }); +// +// final multiCameraStreamStatusChangedListener = emitter.on(EventType.onMultiCameraStreamStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// var status = data['status']; +// for (var user in users.value) { +// { +// if (changedUser.userId == user.userId) { +// if (status == MultiCameraStreamStatus.Joined) { +// user.hasMultiCamera = true; +// } else if (status == MultiCameraStreamStatus.Left) { +// user.hasMultiCamera = false; +// } +// } +// } +// } +// }); +// +// final requireSystemPermission = emitter.on(EventType.onRequireSystemPermission, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// var permissionType = data['permissionType']; +// switch (permissionType) { +// case SystemPermissionType.Camera: +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Can't Access Camera"), +// content: const Text("please turn on the toggle in system settings to grant permission"), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// break; +// case SystemPermissionType.Microphone: +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Can't Access Microphone"), +// content: const Text("please turn on the toggle in system settings to grant permission"), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// break; +// } +// }); +// +// final networkStatusChangeListener = emitter.on(EventType.onUserVideoNetworkStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? networkUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); +// +// if (data['status'] == NetworkStatus.Bad) { +// debugPrint("onUserVideoNetworkStatusChanged: status: ${data['status']}, user: ${networkUser.userName}"); +// } +// }); +// +// final eventErrorListener = emitter.on( +// EventType.onError, +// (data) async { +// data = data as Map; +// String errorType = data['errorType']; +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: Text(errorType), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconncting) { +// Timer( +// const Duration(milliseconds: 1000), +// () => Navigator.pop(context), +// // Navigator.popAndPushNamed( +// // context, +// // "Join", +// // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// // ), +// ); +// } +// }, +// ); +// +// final userRecordingConsentListener = emitter.on(EventType.onUserRecordingConsent, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); +// debugPrint('userRecordingConsentListener: user= ${user.userName}'); +// }); +// +// final callCRCDeviceStatusListener = emitter.on(EventType.onCallCRCDeviceStatusChanged, (data) async { +// data = data as Map; +// debugPrint('onCallCRCDeviceStatusChanged: status = ${data['status']}'); +// }); +// +// final originalLanguageMsgReceivedListener = emitter.on(EventType.onOriginalLanguageMsgReceived, (data) async { +// data = data as Map; +// ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); +// debugPrint("onOriginalLanguageMsgReceived: content: ${messageInfo.messageContent}"); +// }); +// +// final chatPrivilegeChangedListener = emitter.on(EventType.onChatPrivilegeChanged, (data) async { +// data = data as Map; +// String type = data['privilege']; +// debugPrint('chatPrivilegeChangedListener: type= $type'); +// }); +// +// return () => { +// sessionJoinListener.cancel(), +// sessionLeaveListener.cancel(), +// sessionPasswordWrongListener.cancel(), +// sessionNeedPasswordListener.cancel(), +// userVideoStatusChangedListener.cancel(), +// userAudioStatusChangedListener.cancel(), +// userJoinListener.cancel(), +// userLeaveListener.cancel(), +// userNameChangedListener.cancel(), +// userShareStatusChangeListener.cancel(), +// liveStreamStatusChangeListener.cancel(), +// cloudRecordingStatusListener.cancel(), +// inviteByPhoneStatusListener.cancel(), +// eventErrorListener.cancel(), +// commandReceived.cancel(), +// chatDeleteMessageNotify.cancel(), +// liveTranscriptionStatusChangeListener.cancel(), +// liveTranscriptionMsgInfoReceivedListener.cancel(), +// multiCameraStreamStatusChangedListener.cancel(), +// requireSystemPermission.cancel(), +// userRecordingConsentListener.cancel(), +// networkStatusChangeListener.cancel(), +// callCRCDeviceStatusListener.cancel(), +// originalLanguageMsgReceivedListener.cancel(), +// chatPrivilegeChangedListener.cancel(), +// }; +// }, [zoom, users.value, isMounted]); +// +// void onPressAudio() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (mySelf != null) { +// final audioStatus = mySelf.audioStatus; +// if (audioStatus != null) { +// var muted = await audioStatus.isMuted(); +// if (muted) { +// await zoom.audioHelper.unMuteAudio(mySelf.userId); +// } else { +// await zoom.audioHelper.muteAudio(mySelf.userId); +// } +// } +// } +// } +// +// void onPressCameraChange() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (mySelf != null) { +// final videoStatus = mySelf.videoStatus; +// if (videoStatus != null) { +// if (currentCameraDeviceId == "1") { +// currentCameraDeviceId = "2"; +// await zoom.videoHelper.switchCamera("2"); +// } else { +// currentCameraDeviceId = "1"; +// await zoom.videoHelper.switchCamera("1"); +// } +// } +// } +// } +// +// void onPressVideo() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (mySelf != null) { +// final videoStatus = mySelf.videoStatus; +// if (videoStatus != null) { +// var videoOn = await videoStatus.isOn(); +// if (videoOn) { +// await zoom.videoHelper.stopVideo(); +// } else { +// await zoom.videoHelper.startVideo(); +// } +// } +// } +// } +// +// void onPressShare() async { +// var isOtherSharing = await zoom.shareHelper.isOtherSharing(); +// var isShareLocked = await zoom.shareHelper.isShareLocked(); +// +// if (isOtherSharing) { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: const Text('Other is sharing'), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// } else if (isShareLocked) { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: const Text('Share is locked by host'), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// } else if (isSharing.value) { +// zoom.shareHelper.stopShare(); +// } else { +// zoom.shareHelper.shareScreen(); +// } +// } +// +// moreOptions = Center( +// child: Stack( +// children: [ +// Visibility( +// visible: isRenameModalVisible.value, +// child: Row( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Container( +// alignment: Alignment.bottomLeft, +// decoration: const BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(10)), +// color: Colors.white, +// ), +// width: MediaQuery.of(context).size.width - 130, +// height: 130, +// child: Center( +// child: (Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Padding( +// padding: const EdgeInsets.only(top: 20, left: 20), +// child: Text( +// 'Change Name', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w500, +// ), +// ), +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(top: 10, left: 20), +// child: SizedBox( +// width: MediaQuery.of(context).size.width - 230, +// child: TextField( +// onEditingComplete: () {}, +// autofocus: true, +// cursorColor: Colors.black, +// controller: changeNameController, +// decoration: InputDecoration( +// isDense: true, +// hintText: 'New name', +// hintStyle: TextStyle( +// fontSize: 14.0, +// color: chatTextColor, +// ), +// ), +// ), +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(top: 15), +// child: Row( +// children: [ +// Padding( +// padding: const EdgeInsets.only(left: 40), +// child: InkWell( +// child: Text( +// 'Apply', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 16, +// ), +// ), +// ), +// onTap: () async { +// if (fullScreenUser.value != null) { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// await zoom.userHelper.changeName((mySelf?.userId)!, changeNameController.text); +// changeNameController.clear(); +// } +// isRenameModalVisible.value = false; +// }, +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(left: 40), +// child: InkWell( +// child: Text( +// 'Cancel', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 16, +// ), +// ), +// ), +// onTap: () async { +// isRenameModalVisible.value = false; +// }, +// ), +// ) +// ], +// ), +// ) +// ], +// )), +// ), +// ), +// ], +// )), +// ], +// ), +// ); +// +// void onSelectedUserVolume(ZoomVideoSdkUser user) async { +// var isShareAudio = user.isSharing; +// bool canSetVolume = await user.canSetUserVolume(user.userId, isShareAudio); +// num userVolume; +// +// List options = [ +// ListTile( +// title: Text( +// 'Adjust Volume', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w600, +// color: Colors.black, +// ), +// ), +// ), +// ), +// ListTile( +// title: Text( +// 'Current volume', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint('user volume'), +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// debugPrint('user ${user.userName}\'s volume is ${userVolume!}'), +// }, +// ), +// ]; +// if (canSetVolume) { +// options.add( +// ListTile( +// title: Text( +// 'Volume up', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// if (userVolume < 10) +// { +// await user.setUserVolume(user.userId, userVolume + 1, isShareAudio), +// } +// else +// { +// debugPrint("Cannot volume up."), +// } +// }, +// ), +// ); +// options.add( +// ListTile( +// title: Text( +// 'Volume down', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// if (userVolume > 0) +// { +// await user.setUserVolume(user.userId, userVolume - 1, isShareAudio), +// } +// else +// { +// debugPrint("Cannot volume down."), +// } +// }, +// ), +// ); +// } +// showDialog( +// context: context, +// builder: (context) { +// return Dialog( +// elevation: 0.0, +// insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// child: SizedBox( +// height: options.length * 58, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.stretch, +// children: [ +// ListView( +// shrinkWrap: true, +// children: ListTile.divideTiles( +// context: context, +// tiles: options, +// ).toList(), +// ), +// ], +// ), +// )); +// }); +// } +// +// Future onPressMore() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// bool isShareLocked = await zoom.shareHelper.isShareLocked(); +// bool canSwitchSpeaker = await zoom.audioHelper.canSwitchSpeaker(); +// bool canStartRecording = (await zoom.recordingHelper.canStartRecording()) == Errors.Success; +// var startLiveTranscription = (await zoom.liveTranscriptionHelper.getLiveTranscriptionStatus()) == LiveTranscriptionStatus.Start; +// bool canStartLiveTranscription = await zoom.liveTranscriptionHelper.canStartLiveTranscription(); +// bool canStartLiveStream = await zoom.liveStreamHelper.canStartLiveStream() == Errors.Success; +// debugPrint(await zoom.liveStreamHelper.canStartLiveStream()); +// bool startLiveStream = false; +// bool isHost = (mySelf != null) ? (await mySelf.getIsHost()) : false; +// isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(); +// bool canCallOutToCRC = await zoom.CRCHelper.isCRCEnabled(); +// +// List options = [ +// ListTile( +// title: Text( +// 'More', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w600, +// color: Colors.black, +// ), +// ), +// ), +// ), +// ListTile( +// title: Text( +// 'is Support Virtual Background', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint("${await zoom.virtualBackgroundHelper.isSupportVirtualBackground()}"), +// Navigator.of(context).pop(), +// }, +// ), +// ListTile( +// title: Text( +// 'Get Chat Privilege', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint("Chat Privilege = ${await zoom.chatHelper.getChatPrivilege()}"), +// Navigator.of(context).pop(), +// }, +// ), +// ListTile( +// title: Text( +// 'Get Session Dial-in Number infos', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint("session number = ${await zoom.session.getSessionNumber()}"), +// Navigator.of(context).pop(), +// }, +// ), +// ListTile( +// title: Text( +// '${isMicOriginalOn.value ? 'Disable' : 'Enable'} Original Sound', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint("${isMicOriginalOn.value}"), +// await zoom.audioSettingHelper.enableMicOriginalInput(!isMicOriginalOn.value), +// isMicOriginalOn.value = await zoom.audioSettingHelper.isMicOriginalInputEnable(), +// debugPrint("Original sound ${isMicOriginalOn.value ? 'Enabled' : 'Disabled'}"), +// Navigator.of(context).pop(), +// }, +// ) +// ]; +// +// if (canCallOutToCRC) { +// options.add(ListTile( +// title: Text( +// 'Call-out to CRC devices', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint('CRC result = ${await zoom.CRCHelper.callCRCDevice("bjn.vc", ZoomVideoSdkCRCProtocolType.SIP)}'), +// Navigator.of(context).pop(), +// }, +// )); +// options.add(ListTile( +// title: Text( +// 'Cancel call-out to CRC devices', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint('cancel result= ${await zoom.CRCHelper.cancelCallCRCDevice()}'), +// Navigator.of(context).pop(), +// }, +// )); +// } +// +// if (canSwitchSpeaker) { +// options.add(ListTile( +// title: Text( +// 'Turn ${isSpeakerOn.value ? 'off' : 'on'} Speaker', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// await zoom.audioHelper.setSpeaker(!isSpeakerOn.value), +// isSpeakerOn.value = await zoom.audioHelper.getSpeakerStatus(), +// debugPrint('Turned ${isSpeakerOn.value ? 'on' : 'off'} Speaker'), +// Navigator.of(context).pop(), +// }, +// )); +// } +// +// if (isHost) { +// options.add(ListTile( +// title: Text( +// '${isShareLocked ? 'Unlock' : 'Lock'} Share', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// debugPrint("isShareLocked = ${await zoom.shareHelper.lockShare(!isShareLocked)}"), +// Navigator.of(context).pop(), +// })); +// options.add(ListTile( +// title: Text( +// 'Change Name', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () => { +// isRenameModalVisible.value = true, +// Navigator.of(context).pop(), +// }, +// )); +// } +// +// if (canStartLiveTranscription) { +// options.add(ListTile( +// title: Text( +// "${startLiveTranscription ? 'Stop' : 'Start'} Live Transcription", +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// if (startLiveTranscription) +// { +// debugPrint('stopLiveTranscription= ${await zoom.liveTranscriptionHelper.stopLiveTranscription()}'), +// } +// else +// { +// debugPrint('startLiveTranscription= ${await zoom.liveTranscriptionHelper.startLiveTranscription()}'), +// }, +// Navigator.of(context).pop(), +// }, +// )); +// options.add(ListTile( +// title: Text( +// '${isReceiveSpokenLanguageContentEnabled.value ? 'Disable' : 'Enable'} receiving original caption', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// await zoom.liveTranscriptionHelper.enableReceiveSpokenLanguageContent(!isReceiveSpokenLanguageContentEnabled.value), +// isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(), +// debugPrint("isReceiveSpokenLanguageContentEnabled = ${isReceiveSpokenLanguageContentEnabled.value}"), +// Navigator.of(context).pop(), +// })); +// } +// +// if (canStartRecording) { +// options.add(ListTile( +// title: Text( +// '${isRecordingStarted.value ? 'Stop' : 'Start'} Recording', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// if (!isRecordingStarted.value) +// { +// debugPrint('isRecordingStarted = ${await zoom.recordingHelper.startCloudRecording()}'), +// } +// else +// { +// debugPrint('isRecordingStarted = ${await zoom.recordingHelper.stopCloudRecording()}'), +// }, +// Navigator.of(context).pop(), +// })); +// } +// +// if (isVideoOn.value) { +// options.add(ListTile( +// title: Text( +// 'Mirror the video', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// await zoom.videoHelper.mirrorMyVideo(!isVideoMirrored.value), +// isVideoMirrored.value = await zoom.videoHelper.isMyVideoMirrored(), +// Navigator.of(context).pop(), +// })); +// options.add(ListTile( +// title: Text( +// '${isOriginalAspectRatio.value ? 'Enable' : 'Disable'} original aspect ratio', +// style: GoogleFonts.lato( +// textStyle: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// ), +// onTap: () async => { +// await zoom.videoHelper.enableOriginalAspectRatio(!isOriginalAspectRatio.value), +// isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(), +// debugPrint("isOriginalAspectRatio= ${isOriginalAspectRatio.value}"), +// Navigator.of(context).pop(), +// })); +// } +// showDialog( +// context: context, +// builder: (context) { +// return Dialog( +// elevation: 0.0, +// insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// child: SizedBox( +// height: 500, +// child: Scrollbar( +// child: ListView( +// shrinkWrap: true, +// scrollDirection: Axis.vertical, +// children: ListTile.divideTiles( +// context: context, +// tiles: options, +// ).toList(), +// ), +// ), +// ), +// ); +// }); +// } +// +// void onLeaveSession(bool isEndSession) async { +// await zoom.leaveSession(isEndSession); +// Navigator.pop(context); +// // Navigator.pop(context); +// } +// +// void showLeaveOptions() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// bool isHost = await mySelf!.getIsHost(); +// +// onLeaveSession(true); +// +// // Widget endSession; +// // Widget leaveSession; +// // Widget cancel = TextButton( +// // child: const Text('Cancel'), +// // onPressed: () { +// // Navigator.pop(context); //close Dialog +// // }, +// // ); +// +// // switch (defaultTargetPlatform) { +// // case TargetPlatform.android: +// // endSession = TextButton( +// // child: const Text('End Session'), +// // onPressed: () => onLeaveSession(true), +// // ); +// // leaveSession = TextButton( +// // child: const Text('Leave Session'), +// // onPressed: () => onLeaveSession(false), +// // ); +// // break; +// // default: +// // endSession = CupertinoActionSheetAction( +// // isDestructiveAction: true, +// // child: const Text('End Session'), +// // onPressed: () => onLeaveSession(true), +// // ); +// // leaveSession = CupertinoActionSheetAction( +// // child: const Text('Leave Session'), +// // onPressed: () => onLeaveSession(false), +// // ); +// // break; +// // } +// // +// // List options = [ +// // leaveSession, +// // cancel, +// // ]; +// // +// // if (Platform.isAndroid) { +// // if (isHost) { +// // options.removeAt(1); +// // options.insert(0, endSession); +// // } +// // showDialog( +// // context: context, +// // builder: (context) { +// // return AlertDialog( +// // content: const Text("Do you want to leave this session?"), +// // shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))), +// // actions: options, +// // ); +// // }); +// // } else { +// // options.removeAt(1); +// // if (isHost) { +// // options.insert(1, endSession); +// // } +// // showCupertinoModalPopup( +// // context: context, +// // builder: (context) => CupertinoActionSheet( +// // message: const Text('Are you sure that you want to leave the call?'), +// // actions: options, +// // cancelButton: cancel, +// // ), +// // ); +// // } +// } +// +// final chatMessageController = TextEditingController(); +// +// void sendChatMessage(String message) async { +// await zoom.chatHelper.sendChatToAll(message); +// ZoomVideoSdkUser? self = await zoom.session.getMySelf(); +// ZoomVideoSdkCmdChannel cmdChannel = zoom.cmdChannel; +// for (var user in users.value) { +// if (user.userId != self?.userId) { +// await zoom.cmdChannel.sendCommand(user.userId, message); +// } +// } +// chatMessageController.clear(); +// // send the chat as a command +// } +// +// void onSelectedUser(ZoomVideoSdkUser user) async { +// setState(() { +// fullScreenUser.value = user; +// }); +// } +// +// Widget fullScreenView; +// Widget smallView; +// +// if (isInSession.value && fullScreenUser.value != null && users.value.isNotEmpty) { +// fullScreenView = AnimatedOpacity( +// opacity: opacityLevel, +// duration: const Duration(seconds: 3), +// child: VideoView( +// user: fullScreenUser.value, +// hasMultiCamera: false, +// sharing: sharingUser.value == null ? false : (sharingUser.value?.userId == fullScreenUser.value?.userId), +// preview: false, +// focused: false, +// multiCameraIndex: "0", +// videoAspect: VideoAspect.Original, +// fullScreen: true, +// resolution: VideoResolution.Resolution360, +// isPiPView: false, +// ), +// ); +// +// smallView = Container( +// height: 110, +// margin: const EdgeInsets.only(left: 20, right: 20), +// alignment: Alignment.bottomLeft, +// child: VideoView( +// user: users.value[0], +// hasMultiCamera: false, +// sharing: sharingUser.value == null ? false : sharingUser.value?.userId == users.value[0].userId, +// preview: false, +// focused: false, +// multiCameraIndex: "0", +// videoAspect: VideoAspect.Original, +// fullScreen: false, +// resolution: VideoResolution.Resolution180, +// isPiPView: false, +// ), +// +// // ListView.separated( +// // scrollDirection: Axis.horizontal, +// // itemCount: users.value.length, +// // itemBuilder: (BuildContext context, int index) { +// // return InkWell( +// // onTap: () async { +// // onSelectedUser(users.value[index]); +// // }, +// // onDoubleTap: () async { +// // onSelectedUserVolume(users.value[index]); +// // }, +// // child: Center( +// // child: VideoView( +// // user: users.value[index], +// // hasMultiCamera: false, +// // sharing: sharingUser.value == null ? false : sharingUser.value?.userId == users.value[index].userId, +// // preview: false, +// // focused: false, +// // multiCameraIndex: "0", +// // videoAspect: VideoAspect.Original, +// // fullScreen: false, +// // resolution: VideoResolution.Resolution180, +// // isPiPView: false, +// // ), +// // ), +// // ); +// // }, +// // separatorBuilder: (BuildContext context, int index) => const Divider(), +// // ), +// ); +// } else { +// fullScreenView = Container( +// color: Colors.black, +// child: const Center( +// child: Text( +// "Connecting...", +// style: TextStyle( +// fontSize: 20, +// color: Colors.white, +// ), +// ), +// )); +// smallView = Container( +// height: 110, +// color: Colors.transparent, +// ); +// } +// +// _changeOpacity; +// return Scaffold( +// resizeToAvoidBottomInset: false, +// backgroundColor: backgroundColor, +// body: Stack( +// children: [ +// fullScreenView, +// Container( +// padding: const EdgeInsets.only(top: 35), +// child: Stack( +// children: [ +// Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// // Container( +// // height: 70, +// // width: 150, +// // margin: const EdgeInsets.only(top: 16, left: 8), +// // padding: const EdgeInsets.all(8), +// // alignment: Alignment.topLeft, +// // decoration: BoxDecoration( +// // borderRadius: const BorderRadius.all(Radius.circular(8.0)), +// // color: buttonBackgroundColor, +// // ), +// // child: InkWell( +// // onTap: () async { +// // showDialog( +// // context: context, +// // builder: (context) { +// // return Dialog( +// // elevation: 0.0, +// // insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// // child: SizedBox( +// // height: 280, +// // width: 200, +// // child: Column( +// // crossAxisAlignment: CrossAxisAlignment.stretch, +// // children: [ +// // ListView( +// // shrinkWrap: true, +// // children: ListTile.divideTiles( +// // context: context, +// // tiles: [ +// // ListTile( +// // title: Text( +// // 'Session Information', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 18, +// // fontWeight: FontWeight.w600, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Session Name', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // sessionName.value, +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Session Password', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // sessionPassword.value, +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Participants', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // '${users.value.length}', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ], +// // ).toList(), +// // ), +// // ], +// // ), +// // )); +// // }); +// // }, +// // child: Stack( +// // children: [ +// // // Column( +// // // children: [ +// // // const Padding(padding: EdgeInsets.symmetric(vertical: 3)), +// // // Align( +// // // alignment: Alignment.centerLeft, +// // // child: Text( +// // // sessionName.value, +// // // overflow: TextOverflow.ellipsis, +// // // style: GoogleFonts.lato( +// // // textStyle: const TextStyle( +// // // fontSize: 14, +// // // fontWeight: FontWeight.w600, +// // // color: Colors.white, +// // // ), +// // // ), +// // // ), +// // // ), +// // // const Padding(padding: EdgeInsets.symmetric(vertical: 5)), +// // // Align( +// // // alignment: Alignment.centerLeft, +// // // child: Text( +// // // "Participants: ${users.value.length}", +// // // style: GoogleFonts.lato( +// // // textStyle: const TextStyle( +// // // fontSize: 14, +// // // fontWeight: FontWeight.w600, +// // // color: Colors.white, +// // // ), +// // // ), +// // // ), +// // // ) +// // // ], +// // // ), +// // // Container( +// // // alignment: Alignment.centerRight, +// // // child: Image.asset( +// // // "assets/icons/unlocked@2x.png", +// // // height: 22, +// // // )), +// // ], +// // ), +// // ), +// // ), +// TextButton( +// onPressed: (showLeaveOptions), +// child: Container( +// alignment: Alignment.topRight, +// margin: const EdgeInsets.only(top: 16, right: 8), +// padding: const EdgeInsets.only(top: 5, bottom: 5, left: 16, right: 16), +// height: 28, +// decoration: BoxDecoration( +// borderRadius: const BorderRadius.all(Radius.circular(20.0)), +// color: buttonBackgroundColor, +// ), +// child: const Text( +// "LEAVE", +// style: TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.bold, +// color: Color(0xFFE02828), +// ), +// ), +// )), +// ], +// ), +// Align( +// alignment: Alignment.centerRight, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// IconButton( +// onPressed: onPressAudio, +// icon: isMuted.value ? Image.asset("assets/images/new/zoom/unmute@2x.png") : Image.asset("assets/images/new/zoom/mute@2x.png"), +// iconSize: circleButtonSize, +// tooltip: isMuted.value == true ? "Unmute" : "Mute", +// ), +// // IconButton( +// // onPressed: onPressShare, +// // icon: isSharing.value ? Image.asset("assets/images/new/zoom/share-off@2x.png") : Image.asset("assets/images/new/zoom/share-on@2x.png"), +// // iconSize: circleButtonSize, +// // ), +// IconButton( +// onPressed: onPressVideo, +// iconSize: circleButtonSize, +// icon: isVideoOn.value ? Image.asset("assets/images/new/zoom/video-off@2x.png") : Image.asset("assets/images/new/zoom/video-on@2x.png"), +// ), +// IconButton( +// onPressed: onPressCameraChange, +// iconSize: circleButtonSize, +// icon: const Icon( +// Icons.cameraswitch_sharp, +// size: 45.0, +// color: Colors.white, +// ), +// ), +// // IconButton( +// // onPressed: onPressMore, +// // icon: Image.asset("assets/icons/more@2x.png"), +// // iconSize: circleButtonSize, +// // ), +// ], +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(bottom: 120), +// child: smallView, +// ), +// // CommentList(zoom: zoom, eventListener: eventListener), +// moreOptions, +// ], +// )), +// ], +// ) +// // drawer: const MenuBar() +// ); +// } +// } +// +// class CallArguments { +// final bool isJoin; +// final String sessionName; +// final String sessionPwd; +// final String displayName; +// final String sessionIdleTimeoutMins; +// final String role; +// +// CallArguments(this.sessionName, this.sessionPwd, this.displayName, this.sessionIdleTimeoutMins, this.role, this.isJoin); +// } +// +// class JoinArguments { +// final bool isJoin; +// final String sessionName; +// final String sessionPwd; +// final String displayName; +// final String sessionTimeout; +// final String roleType; +// +// JoinArguments(this.isJoin, this.sessionName, this.sessionPwd, this.displayName, this.sessionTimeout, this.roleType); +// } diff --git a/lib/pages/conference/zoom/jwt.dart b/lib/pages/conference/zoom/jwt.dart index c9d373bd..a0f528c0 100644 --- a/lib/pages/conference/zoom/jwt.dart +++ b/lib/pages/conference/zoom/jwt.dart @@ -1,40 +1,40 @@ -import 'dart:math'; - -import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart'; -import 'package:diplomaticquarterapp/pages/conference/zoom/zoom_config.dart'; - -String makeId(int length) { - String result = ""; - String characters = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - int charactersLength = characters.length; - for (var i = 0; i < length; i++) { - result += characters[Random().nextInt(charactersLength)]; - } - return result; -} - -String generateJwt(String sessionName, String roleType) { - try { - var iat = DateTime.now(); - var exp = DateTime.now().add(Duration(days: 2)); - final jwt = JWT( - { - 'app_key': configs["ZOOM_SDK_KEY"], - 'version': 1, - 'user_identity': makeId(10), - 'iat': (iat.millisecondsSinceEpoch / 1000).round(), - 'exp': (exp.millisecondsSinceEpoch / 1000).round(), - 'tpc': sessionName, - 'role_type': int.parse(roleType), - 'cloud_recording_option': 1, - 'cloud_recording_election': 1, - }, - ); - var token = jwt.sign(SecretKey(configs["ZOOM_SDK_SECRET"])); - return token; - } catch (e) { - print(e); - return ''; - } -} +// import 'dart:math'; +// +// import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart'; +// import 'package:diplomaticquarterapp/pages/conference/zoom/zoom_config.dart'; +// +// String makeId(int length) { +// String result = ""; +// String characters = +// "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +// int charactersLength = characters.length; +// for (var i = 0; i < length; i++) { +// result += characters[Random().nextInt(charactersLength)]; +// } +// return result; +// } +// +// String generateJwt(String sessionName, String roleType) { +// try { +// var iat = DateTime.now(); +// var exp = DateTime.now().add(Duration(days: 2)); +// final jwt = JWT( +// { +// 'app_key': configs["ZOOM_SDK_KEY"], +// 'version': 1, +// 'user_identity': makeId(10), +// 'iat': (iat.millisecondsSinceEpoch / 1000).round(), +// 'exp': (exp.millisecondsSinceEpoch / 1000).round(), +// 'tpc': sessionName, +// 'role_type': int.parse(roleType), +// 'cloud_recording_option': 1, +// 'cloud_recording_election': 1, +// }, +// ); +// var token = jwt.sign(SecretKey(configs["ZOOM_SDK_SECRET"])); +// return token; +// } catch (e) { +// print(e); +// return ''; +// } +// } diff --git a/lib/pages/conference/zoom/video_view.dart b/lib/pages/conference/zoom/video_view.dart index 5a53cad2..e45b9319 100644 --- a/lib/pages/conference/zoom/video_view.dart +++ b/lib/pages/conference/zoom/video_view.dart @@ -1,258 +1,258 @@ -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; - -const SHOW_TALKING_ICON_DURATION = 2000; - -class VideoView extends FlutterZoomView.ZoomView { - const VideoView({ - super.key, - required super.user, - required super.sharing, - required super.preview, - required super.focused, - required super.hasMultiCamera, - required super.multiCameraIndex, - required super.videoAspect, - required super.fullScreen, - required super.resolution, - required super.isPiPView, - }); - - @override - Widget build(BuildContext context) { - var isVideoOn = useState(false); - var isTalking = useState(false); - var isMuted = useState(false); - var isMounted = useIsMounted(); - var zoom = ZoomVideoSdk(); - var isSharing = useState(false); - user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); - - useEffect(() { - updateVideoStatus() { - if (user == null) return; - Future.microtask(() async { - if (isMounted()) { - isVideoOn.value = (await user!.videoStatus!.isOn()); - isSharing.value = sharing; - } - }); - } - - resetAudioStatus() { - isTalking.value = false; - isMuted.value = false; - } - - updateAudioStatus() async { - if (!isMounted()) return; - var talking = await user?.audioStatus?.isTalking(); - var muted = await user?.audioStatus?.isMuted(); - isMuted.value = muted!; - isTalking.value = talking!; - if (talking) { - Timer( - const Duration(milliseconds: SHOW_TALKING_ICON_DURATION), - () => { - if (isMounted()) - { - isTalking.value = false, - } - }); - } - } - - updateVideoStatus(); - return null; - }, [zoom, user]); - - ImageIcon audioStatusIcon; - if (isTalking.value) { - audioStatusIcon = const ImageIcon( - AssetImage("assets/images/new/zoom/talking@2x.png"), - ); - } else if (isMuted.value) { - audioStatusIcon = const ImageIcon( - AssetImage("assets/images/new/zoom/muted@2x.png"), - ); - } - // Pass parameters to the platform side. - final Map creationParams = {}; - creationParams.putIfAbsent("userId", () => user?.userId); - creationParams.putIfAbsent("sharing", () => sharing); - creationParams.putIfAbsent("preview", () => preview); - creationParams.putIfAbsent("focused", () => focused); - creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera); - if (videoAspect.isEmpty) { - creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan); - } else { - creationParams.putIfAbsent("videoAspect", () => videoAspect); - } - creationParams.putIfAbsent("fullScreen", () => fullScreen); - if (resolution.isNotEmpty) { - creationParams.putIfAbsent("videoAspect", () => videoAspect); - } - - if (fullScreen) { - if (sharing) { - return Container( - height: MediaQuery.of(context).size.height, - width: MediaQuery.of(context).size.width, - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ); - } else if (isVideoOn.value) { - return Container( - height: MediaQuery.of(context).size.height, - width: MediaQuery.of(context).size.width, - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ); - } else { - return Container( - margin: const EdgeInsets.symmetric(vertical: 0), - child: Container( - alignment: Alignment.center, - child: const Image( - image: AssetImage("assets/images/new/zoom/default-avatar.png"), - )), - ); - } - } else { - if (isVideoOn.value || sharing) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 8), - height: 110, - width: 110, - child: Stack( - children: [ - Container( - height: 110, - width: 110, - decoration: BoxDecoration( - color: const Color(0xff232323), - border: Border.all( - color: const Color(0xff666666), - width: 1, - ), - borderRadius: const BorderRadius.all(Radius.circular(8)), - ), - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ), - Container( - height: 110, - width: 110, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - Container( - alignment: Alignment.bottomCenter, - child: Container( - height: 20, - width: 110, - decoration: const BoxDecoration( - color: Colors.black26, - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(left: 5), - child: Text( - user!.userName, - textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - Container( - alignment: Alignment.bottomRight, - margin: const EdgeInsets.only(right: 5, bottom: 5), - // height: 110, - // width: 110, - child: Image( - height: 12, - width: 12, - image: isMuted.value ? const AssetImage("assets/images/new/zoom/muted@2x.png") : const AssetImage("assets/images/new/zoom/talking@2x.png"), - fit: BoxFit.cover, - ), - ) - ], - ), - ); - } else { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 8), - height: 110, - width: 110, - child: Stack( - children: [ - Container( - height: 110, - width: 110, - decoration: BoxDecoration( - color: const Color(0xff232323), - border: Border.all( - color: const Color(0xff666666), - width: 1, - ), - borderRadius: const BorderRadius.all(Radius.circular(8)), - ), - alignment: Alignment.center, - child: Container( - alignment: Alignment.center, - child: const Image( - height: 60, - width: 60, - image: AssetImage("assets/images/new/zoom/default-avatar.png"), - )), - ), - Align( - alignment: Alignment.bottomCenter, - child: Container( - height: 20, - width: 110, - decoration: const BoxDecoration( - color: Colors.black26, - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(left: 5), - child: Text( - user!.userName, - textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - Container( - alignment: Alignment.bottomRight, - margin: const EdgeInsets.only(right: 5, bottom: 5), - child: Image( - height: 12, - width: 12, - image: isMuted.value ? const AssetImage("assets/images/new/zoom/muted@2x.png") : const AssetImage("assets/images/new/zoom/talking@2x.png"), - fit: BoxFit.cover, - ), - ), - ], - ), - ); - } - } - } -} +// import 'dart:async'; +// +// import 'package:flutter/material.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; +// import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// +// const SHOW_TALKING_ICON_DURATION = 2000; +// +// class VideoView extends FlutterZoomView.ZoomView { +// const VideoView({ +// super.key, +// required super.user, +// required super.sharing, +// required super.preview, +// required super.focused, +// required super.hasMultiCamera, +// required super.multiCameraIndex, +// required super.videoAspect, +// required super.fullScreen, +// required super.resolution, +// required super.isPiPView, +// }); +// +// @override +// Widget build(BuildContext context) { +// var isVideoOn = useState(false); +// var isTalking = useState(false); +// var isMuted = useState(false); +// var isMounted = useIsMounted(); +// var zoom = ZoomVideoSdk(); +// var isSharing = useState(false); +// user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); +// +// useEffect(() { +// updateVideoStatus() { +// if (user == null) return; +// Future.microtask(() async { +// if (isMounted()) { +// isVideoOn.value = (await user!.videoStatus!.isOn()); +// isSharing.value = sharing; +// } +// }); +// } +// +// resetAudioStatus() { +// isTalking.value = false; +// isMuted.value = false; +// } +// +// updateAudioStatus() async { +// if (!isMounted()) return; +// var talking = await user?.audioStatus?.isTalking(); +// var muted = await user?.audioStatus?.isMuted(); +// isMuted.value = muted!; +// isTalking.value = talking!; +// if (talking) { +// Timer( +// const Duration(milliseconds: SHOW_TALKING_ICON_DURATION), +// () => { +// if (isMounted()) +// { +// isTalking.value = false, +// } +// }); +// } +// } +// +// updateVideoStatus(); +// return null; +// }, [zoom, user]); +// +// ImageIcon audioStatusIcon; +// if (isTalking.value) { +// audioStatusIcon = const ImageIcon( +// AssetImage("assets/images/new/zoom/talking@2x.png"), +// ); +// } else if (isMuted.value) { +// audioStatusIcon = const ImageIcon( +// AssetImage("assets/images/new/zoom/muted@2x.png"), +// ); +// } +// // Pass parameters to the platform side. +// final Map creationParams = {}; +// creationParams.putIfAbsent("userId", () => user?.userId); +// creationParams.putIfAbsent("sharing", () => sharing); +// creationParams.putIfAbsent("preview", () => preview); +// creationParams.putIfAbsent("focused", () => focused); +// creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera); +// if (videoAspect.isEmpty) { +// creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan); +// } else { +// creationParams.putIfAbsent("videoAspect", () => videoAspect); +// } +// creationParams.putIfAbsent("fullScreen", () => fullScreen); +// if (resolution.isNotEmpty) { +// creationParams.putIfAbsent("videoAspect", () => videoAspect); +// } +// +// if (fullScreen) { +// if (sharing) { +// return Container( +// height: MediaQuery.of(context).size.height, +// width: MediaQuery.of(context).size.width, +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ); +// } else if (isVideoOn.value) { +// return Container( +// height: MediaQuery.of(context).size.height, +// width: MediaQuery.of(context).size.width, +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ); +// } else { +// return Container( +// margin: const EdgeInsets.symmetric(vertical: 0), +// child: Container( +// alignment: Alignment.center, +// child: const Image( +// image: AssetImage("assets/images/new/zoom/default-avatar.png"), +// )), +// ); +// } +// } else { +// if (isVideoOn.value || sharing) { +// return Container( +// padding: const EdgeInsets.symmetric(horizontal: 8), +// height: 110, +// width: 110, +// child: Stack( +// children: [ +// Container( +// height: 110, +// width: 110, +// decoration: BoxDecoration( +// color: const Color(0xff232323), +// border: Border.all( +// color: const Color(0xff666666), +// width: 1, +// ), +// borderRadius: const BorderRadius.all(Radius.circular(8)), +// ), +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ), +// Container( +// height: 110, +// width: 110, +// decoration: const BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// Container( +// alignment: Alignment.bottomCenter, +// child: Container( +// height: 20, +// width: 110, +// decoration: const BoxDecoration( +// color: Colors.black26, +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(left: 5), +// child: Text( +// user!.userName, +// textAlign: TextAlign.left, +// style: const TextStyle( +// color: Colors.white, +// fontSize: 12, +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomRight, +// margin: const EdgeInsets.only(right: 5, bottom: 5), +// // height: 110, +// // width: 110, +// child: Image( +// height: 12, +// width: 12, +// image: isMuted.value ? const AssetImage("assets/images/new/zoom/muted@2x.png") : const AssetImage("assets/images/new/zoom/talking@2x.png"), +// fit: BoxFit.cover, +// ), +// ) +// ], +// ), +// ); +// } else { +// return Container( +// padding: const EdgeInsets.symmetric(horizontal: 8), +// height: 110, +// width: 110, +// child: Stack( +// children: [ +// Container( +// height: 110, +// width: 110, +// decoration: BoxDecoration( +// color: const Color(0xff232323), +// border: Border.all( +// color: const Color(0xff666666), +// width: 1, +// ), +// borderRadius: const BorderRadius.all(Radius.circular(8)), +// ), +// alignment: Alignment.center, +// child: Container( +// alignment: Alignment.center, +// child: const Image( +// height: 60, +// width: 60, +// image: AssetImage("assets/images/new/zoom/default-avatar.png"), +// )), +// ), +// Align( +// alignment: Alignment.bottomCenter, +// child: Container( +// height: 20, +// width: 110, +// decoration: const BoxDecoration( +// color: Colors.black26, +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(left: 5), +// child: Text( +// user!.userName, +// textAlign: TextAlign.left, +// style: const TextStyle( +// color: Colors.white, +// fontSize: 12, +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomRight, +// margin: const EdgeInsets.only(right: 5, bottom: 5), +// child: Image( +// height: 12, +// width: 12, +// image: isMuted.value ? const AssetImage("assets/images/new/zoom/muted@2x.png") : const AssetImage("assets/images/new/zoom/talking@2x.png"), +// fit: BoxFit.cover, +// ), +// ), +// ], +// ), +// ); +// } +// } +// } +// } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0914288c..5fb3094a 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:app_badge_plus/app_badge_plus.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; @@ -44,10 +45,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_app_icon_badge/flutter_app_icon_badge.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -347,12 +347,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { // HMG_Geofencing(context).loadZones().then((instance) => instance.init()); } void startZoom(){ - var zoom = ZoomVideoSdk(); - InitConfig initConfig = InitConfig( - domain: "zoom.us", - enableLog: true, - ); - zoom.initSdk(initConfig); + // var zoom = ZoomVideoSdk(); + // InitConfig initConfig = InitConfig( + // domain: "zoom.us", + // enableLog: true, + // ); + // zoom.initSdk(initConfig); } void setUserValues(value) async { @@ -539,7 +539,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { fontWeight: FontWeight.bold, color: currentTab == 0 ? CustomColors.backgroudGreyColor - : Theme.of(context).textTheme.headline1!.color, + : Theme.of(context).textTheme.displayLarge!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, @@ -554,7 +554,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { "assets/images/new/menu.svg"), color: Theme.of(context) .textTheme - .headline1! + .displayLarge! .color, onPressed: () => Scaffold.of(context).openDrawer(), @@ -730,7 +730,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { .toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); - FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); + AppBadgePlus.updateBadge(int.parse(notificationCount)); } }); // if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index 59b6702f..893a1357 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:camera/camera.dart'; +// import 'package:camera/camera.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; import 'package:diplomaticquarterapp/pages/conference/zoom/call_screen.dart'; @@ -31,7 +31,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt bool openCallInWeb = true; final player = AudioPlayer(); - late CameraController _controller; + // late CameraController _controller; late Future _initializeControllerFuture; bool isCameraReady = false; @@ -220,11 +220,11 @@ class _IncomingCallState extends State with SingleTickerProviderSt if (widget.incomingCallData!.background == "0") { // Zoom Call Page // Navigator.of(context).pop(); - Navigator.pushReplacementNamed( - context, - "zoom_call_page", - arguments: CallArguments(widget.incomingCallData!.sessionId!, "123", "Patient", "40", "0", false), - ); + // Navigator.pushReplacementNamed( + // context, + // "zoom_call_page", + // arguments: CallArguments(widget.incomingCallData!.sessionId!, "123", "Patient", "40", "0", false), + // ); } else { // OpenTok Call Page await Navigator.of(context).pushReplacement( diff --git a/lib/pages/livecare/video-call-web-page.dart b/lib/pages/livecare/video-call-web-page.dart index 46a29924..f79f6a7b 100644 --- a/lib/pages/livecare/video-call-web-page.dart +++ b/lib/pages/livecare/video-call-web-page.dart @@ -14,7 +14,7 @@ class VideoCallWebPage extends StatelessWidget{ final String receiverId; final String callerId; VideoCallWebPage({required this.receiverId, required this.callerId}){ - request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/Mobileindex.html?username=$receiverId&doctorid=$callerId")); + // request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/Mobileindex.html?username=$receiverId&doctorid=$callerId")); } InAppWebViewGroupOptions options = InAppWebViewGroupOptions( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 45e1a34a..3a1755cf 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -41,7 +41,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -import 'package:local_auth_ios/types/auth_messages_ios.dart'; +import 'package:local_auth_darwin/types/auth_messages_ios.dart'; class ConfirmLogin extends StatefulWidget { final Function? changePageViewIndex; diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index ce69e8c0..0c44d89c 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -363,11 +363,11 @@ class _ConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart index b00e4274..73a577a8 100644 --- a/lib/pages/medical/balance/new_text_Field.dart +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -184,7 +184,7 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ FilteringTextInputFormatter.digitsOnly, @@ -194,9 +194,9 @@ class _NewTextFieldsState extends State { decoration: InputDecoration( labelText: widget.hintText, counterText: widget.counterText, - labelStyle: TextStyle(color: Theme.of(context).textTheme.bodyText1!.color), - errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), + labelStyle: TextStyle(color: Theme.of(context).textTheme.bodyLarge!.color), + errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.error.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.error.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( diff --git a/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart index 5f093eb7..9ab4670f 100644 --- a/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart @@ -112,7 +112,7 @@ class CurvedChartBloodPressure extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart index 882cf034..6b3fed15 100644 --- a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart @@ -161,7 +161,7 @@ class LineChartCurved extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart index 54228d1e..b596e33e 100644 --- a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart @@ -111,7 +111,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart index 9a6616f9..17867ebd 100644 --- a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart @@ -85,7 +85,7 @@ class MonthLineChartCurved extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart index e6ec5c9a..cf2fe435 100644 --- a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart +++ b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart @@ -11,7 +11,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:flutter/material.dart'; -import 'package:health/health.dart'; +// import 'package:health/health.dart'; class syncHealthDataButton extends StatefulWidget { syncHealthDataButton(); @@ -21,7 +21,7 @@ class syncHealthDataButton extends StatefulWidget { } class _syncHealthDataButtonState extends State { - List _healthDataList = []; + // List _healthDataList = []; List Med_InsertTransactionsInputsList = []; List Med_InsertTransactionsInputsList2 = []; @@ -34,8 +34,8 @@ class _syncHealthDataButtonState extends State { int MedCategoryID = 0; - HealthFactory health = HealthFactory(); - List types = [HealthDataType.STEPS, HealthDataType.HEART_RATE, Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING]; + // HealthFactory health = HealthFactory(); + // List types = [HealthDataType.STEPS, HealthDataType.HEART_RATE, Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING]; @override void initState() { @@ -50,26 +50,26 @@ class _syncHealthDataButtonState extends State { checkPermissions() async { if (Platform.isAndroid) { if (await PermissionService.isHealthDataPermissionEnabled()) { - await health.requestAuthorization(types).then((value) { - if (value) { - readAll(); - } - }); + // await health.requestAuthorization(types).then((value) { + // if (value) { + // readAll(); + // } + // }); } else { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).physicalActivityPermission, () async { - await health.requestAuthorization(types).then((value) { - if (value) { - readAll(); - } - }); + // await health.requestAuthorization(types).then((value) { + // if (value) { + // readAll(); + // } + // }); }); } } else { - await health.requestAuthorization(types).then((value) { - if (value) { - readAll(); - } - }); + // await health.requestAuthorization(types).then((value) { + // if (value) { + // readAll(); + // } + // }); } } @@ -82,41 +82,41 @@ class _syncHealthDataButtonState extends State { Med_InsertTransactionsInputsList.clear(); DateTime startDate = DateTime.now().subtract(new Duration(days: 30)); - try { - List healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types); - _healthDataList.addAll(healthData); - } catch (e) { - print("Caught exception in getHealthDataFromTypes: $e"); - } - - _healthDataList = HealthFactory.removeDuplicates(_healthDataList); - - _healthDataList.forEach((x) { - if (x.type == HealthDataType.STEPS) { - Med_InsertTransactionsInputsList.add(healthData( - MedCategoryID: 6, - MedSubCategoryID: MedSubCategoryID, - MachineDate: DateUtil.convertDateToString(x.dateFrom), - Value: double.tryParse(x.value.toString()), - TransactionsListID: TransactionsListID++)); - } - if (x.type == HealthDataType.HEART_RATE) { - Med_InsertTransactionsInputsList.add(healthData( - MedCategoryID: 3, - MedSubCategoryID: MedSubCategoryID, - MachineDate: DateUtil.convertDateToString(x.dateFrom), - Value: double.tryParse(x.value.toString()), - TransactionsListID: TransactionsListID++)); - } - if (x.type == HealthDataType.DISTANCE_DELTA || x.type == HealthDataType.DISTANCE_WALKING_RUNNING) { - Med_InsertTransactionsInputsList.add(healthData( - MedCategoryID: 7, - MedSubCategoryID: MedSubCategoryID, - MachineDate: DateUtil.convertDateToString(x.dateFrom), - Value: double.tryParse(x.value.toString()), - TransactionsListID: TransactionsListID++)); - } - }); + // try { + // List healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types); + // _healthDataList.addAll(healthData); + // } catch (e) { + // print("Caught exception in getHealthDataFromTypes: $e"); + // } + + // _healthDataList = HealthFactory.removeDuplicates(_healthDataList); + + // _healthDataList.forEach((x) { + // if (x.type == HealthDataType.STEPS) { + // Med_InsertTransactionsInputsList.add(healthData( + // MedCategoryID: 6, + // MedSubCategoryID: MedSubCategoryID, + // MachineDate: DateUtil.convertDateToString(x.dateFrom), + // Value: double.tryParse(x.value.toString()), + // TransactionsListID: TransactionsListID++)); + // } + // if (x.type == HealthDataType.HEART_RATE) { + // Med_InsertTransactionsInputsList.add(healthData( + // MedCategoryID: 3, + // MedSubCategoryID: MedSubCategoryID, + // MachineDate: DateUtil.convertDateToString(x.dateFrom), + // Value: double.tryParse(x.value.toString()), + // TransactionsListID: TransactionsListID++)); + // } + // if (x.type == HealthDataType.DISTANCE_DELTA || x.type == HealthDataType.DISTANCE_WALKING_RUNNING) { + // Med_InsertTransactionsInputsList.add(healthData( + // MedCategoryID: 7, + // MedSubCategoryID: MedSubCategoryID, + // MachineDate: DateUtil.convertDateToString(x.dateFrom), + // Value: double.tryParse(x.value.toString()), + // TransactionsListID: TransactionsListID++)); + // } + // }); getAllHealthDataLists(); } diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index e86f31bf..c77c34eb 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -99,7 +99,7 @@ class LineChartCurved extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart index 7bcf8977..b570360a 100644 --- a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -140,7 +140,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/pages/videocall-webrtc-rnd/js_wrapper/multistreammixer-wrapper.dart b/lib/pages/videocall-webrtc-rnd/js_wrapper/multistreammixer-wrapper.dart index b21a345d..d8d5ba29 100644 --- a/lib/pages/videocall-webrtc-rnd/js_wrapper/multistreammixer-wrapper.dart +++ b/lib/pages/videocall-webrtc-rnd/js_wrapper/multistreammixer-wrapper.dart @@ -1,6 +1,7 @@ @JS() library streammixer.js; -import 'package:js/js.dart'; +import 'dart:js/js_wasm.dart'; + @JS('multiStreamsMixerFlutter') diff --git a/lib/routes.dart b/lib/routes.dart index 6e8aca9e..4eb42f4e 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -89,7 +89,7 @@ var routes = { // CALL_PAGE: (_) => CallPage(), INCOMING_CALL_PAGE: (_) => IncomingCall(), - ZOOM_CALL_PAGE: (_) => CallScreen(), + // ZOOM_CALL_PAGE: (_) => CallScreen(), OPENTOK_CALL_PAGE: (_) => OpenTokConnectCallPage( apiKey: OPENTOK_API_KEY, diff --git a/lib/services/payfort_services/payfort_service.dart b/lib/services/payfort_services/payfort_service.dart index 3a1f037f..07363aab 100644 --- a/lib/services/payfort_services/payfort_service.dart +++ b/lib/services/payfort_services/payfort_service.dart @@ -162,23 +162,23 @@ class PayfortService extends BaseService { ); if (sdkTokenResponse != null && sdkTokenResponse.sdkToken == null) { - onFailed!(sdkTokenResponse.responseMessage ?? ''); + onFailed!(PayFortFailureResult(message: sdkTokenResponse.responseMessage ?? '')); return; } /// Step 4: Processing Payment [Don't multiply with 100] /// Amount value send always round ex. [100] not [100.00, 100.21] FortRequest request = FortRequest( - amount: orderAmount!, - customerName: customerName!, - customerEmail: customerEmail!, - orderDescription: orderDescription!, - sdkToken: sdkTokenResponse?.sdkToken ?? '', - merchantReference: merchantReference!, - currency: currency, - customerIp: (await _info.getWifiIP() ?? ''), - language: 'en' - ); + amount: orderAmount!, + customerName: customerName!, + customerEmail: customerEmail!, + orderDescription: orderDescription!, + sdkToken: sdkTokenResponse?.sdkToken ?? '', + merchantReference: merchantReference!, + currency: currency, + customerIp: (await _info.getWifiIP() ?? ''), + language: 'en', + command: FortCommand.purchase); _payfort.callPayFortForApplePay( request: request, @@ -190,7 +190,7 @@ class PayfortService extends BaseService { ), ); } catch (e) { - onFailed!(e.toString()); + onFailed!(PayFortFailureResult(message: e.toString())); } } } diff --git a/lib/services/permission/permission_service.dart b/lib/services/permission/permission_service.dart index 641d6444..ef2fabca 100644 --- a/lib/services/permission/permission_service.dart +++ b/lib/services/permission/permission_service.dart @@ -7,17 +7,18 @@ import 'package:vibration/vibration.dart'; import 'package:geolocator/geolocator.dart' as geo; class PermissionService extends BaseService { - final LocalStorage storage = new LocalStorage("permission"); + // final LocalStorage storage = LocalStorage(); + geo.LocationPermission? locationPermission; AppGlobal appGlobal = new AppGlobal(); setVibrationPermission(flag) async { - storage.setItem('isVibration', flag); + localStorage.setItem('isVibration', flag); } isVibrationEnabled() { - return (storage.getItem('isVibration') == null) || - (storage.getItem('isVibration')) == false + return (localStorage.getItem('isVibration') == null) || + (localStorage.getItem('isVibration')) == false ? false : true; } @@ -35,11 +36,11 @@ class PermissionService extends BaseService { } setTheme(flag) async { - storage.setItem('isTheme', flag); + localStorage.setItem('isTheme', flag); } isThemeEnabled() { - return storage.getItem('isTheme'); + return localStorage.getItem('isTheme'); } cameraPermission() async { diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 255e5fbd..a7b41fca 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -13,7 +13,7 @@ import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; import 'package:provider/provider.dart'; import 'core/service/AuthenticatedUserObject.dart'; @@ -54,12 +54,12 @@ class _SplashScreenState extends State { }, ); - var zoom = ZoomVideoSdk(); - InitConfig initConfig = InitConfig( - domain: "zoom.us", - enableLog: true, - ); - zoom.initSdk(initConfig); + // var zoom = ZoomVideoSdk(); + // InitConfig initConfig = InitConfig( + // domain: "zoom.us", + // enableLog: true, + // ); + // zoom.initSdk(initConfig); // AppSharedPreferences().getAll().then((value) { // debugPrint("ALL SHARED PREFERENCES!!!!!"); diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index 9ee0c2db..595b7af3 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/Constants.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -10,63 +9,56 @@ import 'package:flutter/services.dart'; final bluePrimary = Color(0xFF00000); final blueAccent = Color(0xFFFF9800); final blueBackground = Color(0xFFFFFFFF); -const MaterialColor appColor = MaterialColor( - 0xFF045531, - { - 50: Color(0xFFFFEBEE), - 100: Color(0xFF2E6049), - 200: Color(0xFF185339), - 300: Color(0xFF125939), - 400: Color(0xE6085734), - 500: Color(0xFF045531), - 600: Color(0xFF024024), - 700: Color(0xFF034226), - 800: Color(0xFF022C1A), - 900: Color(0xFF011C10), - }, -); +const MaterialColor appColor = MaterialColor(0xFF045531, { + 50: Color(0xFFFFEBEE), + 100: Color(0xFF2E6049), + 200: Color(0xFF185339), + 300: Color(0xFF125939), + 400: Color(0xE6085734), + 500: Color(0xFF045531), + 600: Color(0xFF024024), + 700: Color(0xFF034226), + 800: Color(0xFF022C1A), + 900: Color(0xFF011C10), +}); + defaultTheme({fontName}) { return ThemeData( fontFamily: fontName, useMaterial3: false, - //projectProvider.isArabic ? 'Cairo' : 'WorkSans', + // projectProvider.isArabic ? 'Cairo' : 'WorkSans', primarySwatch: appColor, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: ZoomPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - }, - ), + pageTransitionsTheme: const PageTransitionsTheme(builders: {TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder()}), hintColor: Colors.grey[400], disabledColor: Colors.grey[300], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffF8F8F8), canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff515A5D), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), - primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)), + primaryTextTheme: TextTheme(bodyMedium: TextStyle(color: Colors.white)), iconTheme: IconThemeData(), textTheme: TextTheme( - bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), - headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), - headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), + bodyLarge: TextStyle(color: Colors.black, letterSpacing: 0.6), + displayLarge: TextStyle(color: Colors.white, letterSpacing: 0.6), + displayMedium: TextStyle(color: Colors.white, letterSpacing: 0.6), ), floatingActionButtonTheme: FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), appBarTheme: AppBarTheme( color: Color(0xff515A5D), elevation: 0.0, - actionsIconTheme: IconThemeData( - color: Colors.grey[800], - ), systemOverlayStyle: SystemUiOverlayStyle.dark, - ), textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey,), + actionsIconTheme: IconThemeData(color: Colors.grey[800]), + systemOverlayStyle: SystemUiOverlayStyle.dark, + ), + textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), ); } @@ -78,33 +70,32 @@ invertThemes({fontName}) { useMaterial3: false, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.dark, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: ZoomPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - }, - ), + pageTransitionsTheme: const PageTransitionsTheme(builders: {TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder()}), hintColor: Colors.grey[400], - textTheme: TextTheme(bodyText1: TextStyle(color: Colors.white), headline1: TextStyle(color: Colors.white), headline2: TextStyle(color: Colors.white)), + textTheme: TextTheme( + bodyLarge: TextStyle(color: Colors.white), + displayLarge: TextStyle(color: Colors.white), + displayMedium: TextStyle(color: Colors.white), + ), disabledColor: Colors.grey[800], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xff000000), canvasColor: Colors.black, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff515A5D), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), iconTheme: IconThemeData(), appBarTheme: AppBarTheme( color: Color(0xff000000), elevation: 0.0, - actionsIconTheme: IconThemeData( - color: Colors.grey[800], - ), systemOverlayStyle: SystemUiOverlayStyle.light, - ), textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.black, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey,), + actionsIconTheme: IconThemeData(color: Colors.grey[800]), + systemOverlayStyle: SystemUiOverlayStyle.light, + ), + textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.black, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), ); } @@ -118,43 +109,37 @@ bwThemes({fontName}) { brightness: Brightness.dark, unselectedWidgetColor: Colors.red, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: ZoomPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - }, - ), + pageTransitionsTheme: const PageTransitionsTheme(builders: {TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder()}), hintColor: Colors.grey[400], textTheme: TextTheme( - bodyText1: TextStyle(color: appColor[900]), - headline1: TextStyle(color: appColor[900]), - headline2: TextStyle(color: Colors.white), - bodyText2: TextStyle(color: appColor[900]), - subtitle1: TextStyle(color: appColor[900]), + bodyMedium: TextStyle(color: appColor[900]), + headlineLarge: TextStyle(color: appColor[900]), + headlineMedium: TextStyle(color: Colors.white), + bodyLarge: TextStyle(color: appColor[900]), + titleMedium: TextStyle(color: appColor[900]), ), - tabBarTheme: TabBarTheme(labelColor: appColor[900]), - + // tabBarTheme: TabBarTheme(labelColor: appColor[900]), disabledColor: Colors.grey[800], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffffffe4), canvasColor: Colors.black, - backgroundColor: Color(0xffffffe4), + // backgroundColor: Color(0xffffffe4), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xfffffff4), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), iconTheme: IconThemeData(), appBarTheme: AppBarTheme( color: Color(0xffffffe4), elevation: 0.0, - actionsIconTheme: IconThemeData( - color: Colors.grey[800], - ), systemOverlayStyle: SystemUiOverlayStyle.light, - ), textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.black, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey,), + actionsIconTheme: IconThemeData(color: Colors.grey[800]), + systemOverlayStyle: SystemUiOverlayStyle.light, + ), + textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.black, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), ); } @@ -166,18 +151,13 @@ dimTheme({fontName}) { visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.dark, useMaterial3: false, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: ZoomPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - }, - ), + pageTransitionsTheme: const PageTransitionsTheme(builders: {TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder()}), hintColor: Colors.grey[400], disabledColor: Colors.grey[300], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffEEEEEE), canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff40ACC9), @@ -186,9 +166,9 @@ dimTheme({fontName}) { appBarTheme: AppBarTheme( color: Color(0xff40ACC9), elevation: 10.0, - actionsIconTheme: IconThemeData( - color: Color(0xff40ACC9), - ), systemOverlayStyle: SystemUiOverlayStyle.light, - ), textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey,), + actionsIconTheme: IconThemeData(color: Color(0xff40ACC9)), + systemOverlayStyle: SystemUiOverlayStyle.light, + ), + textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), ); } diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index 57ec961a..05c0b193 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -2,10 +2,10 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; import 'dart:ui'; - import 'package:device_calendar/device_calendar.dart'; import 'package:manage_calendar_events/manage_calendar_events.dart' as ios; + final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); final ios.CalendarPlugin _myPlugin = ios.CalendarPlugin(); diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 0cdef6ca..ead098fe 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -31,7 +31,7 @@ class LocalNotification { _initialize() async { try { var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null); + var initializationSettingsIOS = DarwinInitializationSettings(); var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); await flutterLocalNotificationsPlugin.initialize( initializationSettings, diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index bbeebe5d..651e92a3 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -70,7 +70,7 @@ class AppToast { child: toast, gravity: ToastGravity.TOP, toastDuration: Duration(seconds: timeInSeconds), - positionedToastBuilder: (context, child) { + positionedToastBuilder: (context, child, _) { return Positioned(top: 50, left: 10, right: 10, child: child); }); // Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize); diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 90119490..d022321d 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:huawei_location/huawei_location.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -98,7 +97,7 @@ class LocationUtils { return true; } - late LocationCallback _locationCallback; + // late LocationCallback _locationCallback; _getHMSCurrentLocation(Function(LatLng) callBack) async { PermissionStatus permissionHandler = await Permission.location.request(); @@ -106,55 +105,55 @@ class LocationUtils { // print(statuses[Permission.location]); int _locationUpdateCbId = 0; - doIt() { - FusedLocationProviderClient locationService = FusedLocationProviderClient(); - LocationRequest locationRequest = LocationRequest(); - locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY; - locationRequest.interval = 1000; - List locationRequestList = [locationRequest]; - LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); - - locationService.checkLocationSettings(locationSettingsRequest).then((settings) async { - _locationUpdateCbId = await locationService.requestLocationUpdatesCb( - locationRequest, - LocationCallback(onLocationResult: (locationResult) { - Location location = locationResult.lastLocation!; - locationService.removeLocationUpdatesCb(_locationUpdateCbId); - callBack(LatLng(location.latitude!, location.longitude!)); - setLocation( - Position( - latitude: location.latitude!, - longitude: location.longitude!, - altitude: location.altitude!, - timestamp: DateTime.now(), - accuracy: 1.0, - heading: 0.0, - speed: 0.0, - speedAccuracy: 1, altitudeAccuracy: 0.0, headingAccuracy: 0.0, - // altitudeAccuracy: 0.0, - // headingAccuracy: 0.0, - // altitudeAccuracy: 0, - // headingAccuracy: 0, - // Added by Aamir - ), - ); - }, onLocationAvailability: (locationAvailability) { - print("onLocationAvailability: $locationAvailability"); - })); - }).catchError((error) { - if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { - // Location service not enabled. - } - }); - } + // doIt() { + // FusedLocationProviderClient locationService = FusedLocationProviderClient(); + // LocationRequest locationRequest = LocationRequest(); + // locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY; + // locationRequest.interval = 1000; + // List locationRequestList = [locationRequest]; + // LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); + // + // locationService.checkLocationSettings(locationSettingsRequest).then((settings) async { + // _locationUpdateCbId = await locationService.requestLocationUpdatesCb( + // locationRequest, + // LocationCallback(onLocationResult: (locationResult) { + // Location location = locationResult.lastLocation!; + // locationService.removeLocationUpdatesCb(_locationUpdateCbId); + // callBack(LatLng(location.latitude!, location.longitude!)); + // setLocation( + // Position( + // latitude: location.latitude!, + // longitude: location.longitude!, + // altitude: location.altitude!, + // timestamp: DateTime.now(), + // accuracy: 1.0, + // heading: 0.0, + // speed: 0.0, + // speedAccuracy: 1, altitudeAccuracy: 0.0, headingAccuracy: 0.0, + // // altitudeAccuracy: 0.0, + // // headingAccuracy: 0.0, + // // altitudeAccuracy: 0, + // // headingAccuracy: 0, + // // Added by Aamir + // ), + // ); + // }, onLocationAvailability: (locationAvailability) { + // print("onLocationAvailability: $locationAvailability"); + // })); + // }).catchError((error) { + // if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { + // // Location service not enabled. + // } + // }); + // } if (await permissionHandler.isGranted) { - doIt(); + // doIt(); } else { bool has = await requestPermissions(); - if (has) - doIt(); - else if (isShowConfirmDialog) showErrorLocationDialog(false); + // if (has) + // doIt(); + // else if (isShowConfirmDialog) showErrorLocationDialog(false); } } diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 6372e326..af4b8363 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -21,12 +21,12 @@ import 'package:firebase_messaging/firebase_messaging.dart' as fir; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; + // import 'package:flutter_ios_voip_kit/call_state_type.dart'; // import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:get_it/get_it.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; -import 'package:huawei_push/huawei_push.dart' as h_push; +// import 'package:huawei_push/huawei_push.dart' as h_push; import 'package:permission_handler/permission_handler.dart'; import 'app_shared_preferences.dart'; @@ -37,11 +37,11 @@ import 'navigation_service.dart'; Future backgroundMessageHandler(dynamic message) async { print("Firebase backgroundMessageHandler!!!"); fir.RemoteMessage message_; - if (message is h_push.RemoteMessage) { - // if huawei remote message convert it to Firebase Remote Message - message_ = toFirebaseRemoteMessage(message); - h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); - } + // if (message is h_push.RemoteMessage) { + // // if huawei remote message convert it to Firebase Remote Message + // message_ = toFirebaseRemoteMessage(message); + // h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); + // } if (message.data != null && (message.data['is_call'] == 'true' || message.data['is_call'] == true)) { // showCallkitIncoming(message); @@ -53,47 +53,46 @@ Future backgroundMessageHandler(dynamic message) async { notification.createdOn = DateUtil.convertDateToString(DateTime.now()); notification.messageTypeData = message.data['picture']; notification.message = message.data['message']; - await NavigationService.navigateToPage(NotificationsDetailsPage( - notification: notification, - )); + await NavigationService.navigateToPage(NotificationsDetailsPage(notification: notification)); } } // Push Notification Background <--| -RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) { - final payload_data = jsonDecode(message.data!); - final fire_message = RemoteMessage( - from: message.from, - collapseKey: message.collapseKey, - data: payload_data['data'], - messageId: message.messageId, - sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime! * 1000), - ttl: message.ttl, - category: null, - messageType: message.type, - notification: RemoteNotification( - title: message.notification!.title!, - titleLocArgs: (message.notification!.titleLocalizationArgs! ?? []).map((e) => e.toString()).toList(), - titleLocKey: message.notification!.titleLocalizationKey!, - body: message.notification!.body!, - bodyLocArgs: (message.notification!.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(), - bodyLocKey: message.notification!.bodyLocalizationKey, - android: AndroidNotification( - channelId: message.notification!.channelId, - clickAction: message.notification!.clickAction, - color: message.notification!.color, - count: null, - imageUrl: message.notification!.imageUrl!.path, - link: message.notification!.link!.path, - smallIcon: message.notification!.icon, - sound: message.notification!.sound, - ticker: message.notification!.ticker, - tag: message.notification!.tag, - ), - )); - return fire_message; -} +// RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) { +// final payload_data = jsonDecode(message.data!); +// final fire_message = RemoteMessage( +// from: message.from, +// collapseKey: message.collapseKey, +// data: payload_data['data'], +// messageId: message.messageId, +// sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime! * 1000), +// ttl: message.ttl, +// category: null, +// messageType: message.type, +// notification: RemoteNotification( +// title: message.notification!.title!, +// titleLocArgs: (message.notification!.titleLocalizationArgs! ?? []).map((e) => e.toString()).toList(), +// titleLocKey: message.notification!.titleLocalizationKey!, +// body: message.notification!.body!, +// bodyLocArgs: (message.notification!.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(), +// bodyLocKey: message.notification!.bodyLocalizationKey, +// android: AndroidNotification( +// channelId: message.notification!.channelId, +// clickAction: message.notification!.clickAction, +// color: message.notification!.color, +// count: null, +// imageUrl: message.notification!.imageUrl!.path, +// link: message.notification!.link!.path, +// smallIcon: message.notification!.icon, +// sound: message.notification!.sound, +// ticker: message.notification!.ticker, +// tag: message.notification!.tag, +// ), +// ), +// ); +// return fire_message; +// } // callPage(String sessionID, String token, String isWebrtc, String callerIdString) async { callPage(String sessionID, String token) async { @@ -163,10 +162,7 @@ _incomingCall(Map data) async { if (LandingPage.isOpenCallPage == false) { LandingPage.isOpenCallPage = true; final bool permited = await AppPermission.askVideoCallPermission(currentContext!); - if (permited) - await NavigationService.navigateToPage( - IncomingCall(incomingCallData: LandingPage.incomingCallData), - ); + if (permited) await NavigationService.navigateToPage(IncomingCall(incomingCallData: LandingPage.incomingCallData)); LandingPage.isOpenCallPage = false; } @@ -178,7 +174,7 @@ class PushNotificationHandler { late BuildContext context; static final PushNotificationHandler _instance = PushNotificationHandler._internal(); - late HmsApiAvailability hmsApiAvailability; + //late HmsApiAvailability hmsApiAvailability; // final voIPKit = FlutterIOSVoIPKit.instance; @@ -202,7 +198,7 @@ class PushNotificationHandler { "DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", "callerID": "9920", "PatientID": "1231755", - "is_call": "true" + "is_call": "true", }; PushNotificationHandler._internal(); @@ -283,23 +279,23 @@ class PushNotificationHandler { if (Platform.isAndroid) { try { if (!(await Utils.isGoogleServicesAvailable())) { - h_push.Push.enableLogger(); - final result = await h_push.Push.setAutoInitEnabled(true); - - h_push.Push.onNotificationOpenedApp.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.onMessageReceivedStream.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.getTokenStream.listen((token) { - onToken(token); - }, onError: (e) => print(e.toString())); - h_push.Push.getToken(''); - - h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + // h_push.Push.enableLogger(); + // final result = await h_push.Push.setAutoInitEnabled(true); + // + // h_push.Push.onNotificationOpenedApp.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.onMessageReceivedStream.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.getTokenStream.listen((token) { + // onToken(token); + // }, onError: (e) => print(e.toString())); + // h_push.Push.getToken(''); + // + // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); } else { final fcmToken = await FirebaseMessaging.instance.getToken(); if (fcmToken != null) onToken(fcmToken); @@ -326,7 +322,8 @@ class PushNotificationHandler { await Future.delayed(Duration(milliseconds: 3000)).then((value) { if (message != null) newMessage(message); }); - else if (message != null) newMessage(message); + else if (message != null) + newMessage(message); } }); } catch (ex) {} @@ -400,9 +397,7 @@ class PushNotificationHandler { notification.videoURL = remoteMessage.data["VideoUrl"]; } - await NavigationService.navigateToPage(NotificationsDetailsPage( - notification: notification, - )); + await NavigationService.navigateToPage(NotificationsDetailsPage(notification: notification)); } } @@ -433,8 +428,8 @@ class PushNotificationHandler { print("=-=-=-=-=-=-=-=-=-=-"); print(statuses[Permission.location]); } - } catch (_) { - debugPrint(_.toString()); + } catch (val) { + debugPrint(val.toString()); } } } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 78ea4d79..30da030b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -46,7 +46,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_api_availability/google_api_availability.dart'; import 'dart:math' show asin, cos, pi, pow, sin, sqrt; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; @@ -76,14 +75,10 @@ class Utils { } /// Check The Internet Connection - static Future checkConnection( - {bool bypassConnectionCheck = false}) async { + static Future checkConnection({bool bypassConnectionCheck = false}) async { if (bypassConnectionCheck) return true; - //return true; - ConnectivityResult connectivityResult = - await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || - (connectivityResult == ConnectivityResult.wifi)) { + final List connectivityResult = await (Connectivity().checkConnectivity()); + if ((connectivityResult.contains(ConnectivityResult.mobile)) || (connectivityResult.contains(ConnectivityResult.wifi))) { return true; } else { return false; @@ -104,16 +99,11 @@ class Utils { FocusScope.of(context).unfocus(); } - static showPermissionConsentDialog( - BuildContext context, String message, VoidCallback? onTap) { + static showPermissionConsentDialog(BuildContext context, String message, VoidCallback? onTap) { showDialog( - context: context, - builder: (cxt) => CovidConsentDialog( - okTitle: TranslationBase.of(context).acceptLbl, - title: TranslationBase.of(context).covidConsentHeader, - message: message, - onTap: onTap!, - )); + context: context, + builder: (cxt) => CovidConsentDialog(okTitle: TranslationBase.of(context).acceptLbl, title: TranslationBase.of(context).covidConsentHeader, message: message, onTap: onTap!), + ); } bool isSAUDIIDValid(String id, type) { @@ -158,27 +148,13 @@ class Utils { } } - static String getAppointmentTransID(int projectID, int clinicID, int appoNo, - {bool isAddMilliseconds = true}) { + static String getAppointmentTransID(int projectID, int clinicID, int appoNo, {bool isAddMilliseconds = true}) { String currentMillis = DateTime.now().millisecondsSinceEpoch.toString(); - return projectID.toString() + - '-' + - clinicID.toString() + - '-' + - appoNo.toString() + - (isAddMilliseconds - ? '-' + - currentMillis.substring( - currentMillis.length - 5, currentMillis.length) - : ""); + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString() + (isAddMilliseconds ? '-' + currentMillis.substring(currentMillis.length - 5, currentMillis.length) : ""); } static String getAdvancePaymentTransID(int projectID, int fileNumber) { - return projectID.toString() + - '-' + - fileNumber.toString() + - '-' + - DateTime.now().millisecondsSinceEpoch.toString(); + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString(); } bool validateIDBox(String value, int type) { @@ -237,130 +213,124 @@ class Utils { } static validEmail(email) { - return RegExp( - r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") - .hasMatch(email); + return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email); } - static List myMedicalList( - {ProjectViewModel? projectViewModel, - BuildContext? context, - bool? isLogin, - count, - Function? onWeCareClick}) { + static List myMedicalList({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count, Function? onWeCareClick}) { List medical = []; - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(5) - ? Navigator.push(context, FadePage(page: MyAppointments())) - : null, - child: isLogin! - ? Stack(children: [ - Container( - width: double.infinity, - height: double.infinity, - child: MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null, + child: isLogin! + ? Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + child: MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), + ), + // projectViewModel.isArabic + // ? !projectViewModel.user.isFamily + // ? Positioned( + // left: 8, + // top: 4, + // child: badge_import.Badge( + // badgeAnimation: badge_import.BadgeAnimation.fade( + // toAnimate: false), + // badgeStyle: badge_import.BadgeStyle( + // elevation: 0, + // shape: badge_import.BadgeShape.circle, + // badgeColor: secondaryColor!.withOpacity(1.0), + // borderRadius: BorderRadius.circular(8), + // ), + // position: badge_import.BadgePosition.topEnd(), + // badgeContent: Container( + // padding: EdgeInsets.all(2.0), + // child: Text(count.toString(), + // style: TextStyle( + // color: Colors.white, + // fontWeight: FontWeight.bold, + // fontSize: 12.0)), + // ), + // ), + // ) + // : Container() + // : !projectViewModel.user!.isFamily + // ? Positioned( + // right: 8, + // top: 4, + // child: badge_import.Badge( + // position: badge_import.BadgePosition.topEnd(), + // badgeAnimation: badge_import.BadgeAnimation.fade( + // toAnimate: false), + // badgeStyle: badge_import.BadgeStyle( + // elevation: 0, + // shape: badge_import.BadgeShape.circle, + // badgeColor: secondaryColor!.withOpacity(1.0), + // borderRadius: BorderRadius.circular(8), + // ), + // badgeContent: Container( + // padding: EdgeInsets.all(2.0), + // child: Text(count.toString(), + // style: TextStyle( + // color: Colors.white, + // fontWeight: FontWeight.bold, + // fontSize: 12.0)), + // ), + // ), + // ) + // : Container(), + ], + ) + : MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), ), - // projectViewModel.isArabic - // ? !projectViewModel.user.isFamily - // ? Positioned( - // left: 8, - // top: 4, - // child: badge_import.Badge( - // badgeAnimation: badge_import.BadgeAnimation.fade( - // toAnimate: false), - // badgeStyle: badge_import.BadgeStyle( - // elevation: 0, - // shape: badge_import.BadgeShape.circle, - // badgeColor: secondaryColor!.withOpacity(1.0), - // borderRadius: BorderRadius.circular(8), - // ), - // position: badge_import.BadgePosition.topEnd(), - // badgeContent: Container( - // padding: EdgeInsets.all(2.0), - // child: Text(count.toString(), - // style: TextStyle( - // color: Colors.white, - // fontWeight: FontWeight.bold, - // fontSize: 12.0)), - // ), - // ), - // ) - // : Container() - // : !projectViewModel.user!.isFamily - // ? Positioned( - // right: 8, - // top: 4, - // child: badge_import.Badge( - // position: badge_import.BadgePosition.topEnd(), - // badgeAnimation: badge_import.BadgeAnimation.fade( - // toAnimate: false), - // badgeStyle: badge_import.BadgeStyle( - // elevation: 0, - // shape: badge_import.BadgeShape.circle, - // badgeColor: secondaryColor!.withOpacity(1.0), - // borderRadius: BorderRadius.circular(8), - // ), - // badgeContent: Container( - // padding: EdgeInsets.all(2.0), - // child: Text(count.toString(), - // style: TextStyle( - // color: Colors.white, - // fontWeight: FontWeight.bold, - // fontSize: 12.0)), - // ), - // ), - // ) - // : Container(), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), - ), - )); + ), + ); // if (projectViewModel.havePrivilege(10)) { - medical.add(InkWell( - onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).lab, - imagePath: 'lab_result.svg', - subTitle: TranslationBase.of(context).labSubtitle, + medical.add( + InkWell( + onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), + child: MedicalProfileItem(title: TranslationBase.of(context).lab, imagePath: 'lab_result.svg', subTitle: TranslationBase.of(context).labSubtitle), ), - )); + ); // } - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(7) - ? Navigator.push(context, FadePage(page: RadiologyHomePage())) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, - isEnable: projectViewModel.havePrivilege(7), + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology.svg', + subTitle: TranslationBase.of(context).radiologySubtitle, + isEnable: projectViewModel.havePrivilege(7), + ), ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(12) - ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, - imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase.of(context).medicinesSubtitle, - isEnable: projectViewModel.havePrivilege(12), + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'medicine_prescription.svg', + subTitle: TranslationBase.of(context).medicinesSubtitle, + isEnable: projectViewModel.havePrivilege(12), + ), ), - )); + ); // medical.add(InkWell( // onTap: () => projectViewModel.havePrivilege(25) @@ -377,34 +347,31 @@ class Utils { // ), // )); - medical.add(InkWell( - onTap: () { - if (projectViewModel.havePrivilege(48)) - Navigator.push(context, FadePage(page: ActiveMedicationsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, - imagePath: 'active_medication.svg', - subTitle: TranslationBase.of(context).myMedicalSubtitle, - isEnable: projectViewModel.havePrivilege(48), + medical.add( + InkWell( + onTap: () { + if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myMedical, + imagePath: 'active_medication.svg', + subTitle: TranslationBase.of(context).myMedicalSubtitle, + isEnable: projectViewModel.havePrivilege(48), + ), ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(6) - ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) - : null, - child: MedicalProfileItem( + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(6) ? Navigator.push(context, FadePage(page: DoctorHomePage())) : null, + child: MedicalProfileItem( title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, - isEnable: projectViewModel.havePrivilege(6)), - )); + isEnable: projectViewModel.havePrivilege(6), + ), + ), + ); // medical.add(InkWell( // onTap: () => projectViewModel.havePrivilege(14) @@ -636,26 +603,27 @@ class Utils { return medical; } - static getPatientWifiCredentials(String patientID, - Function(String username, String password) successCallback) { + static getPatientWifiCredentials(String patientID, Function(String username, String password) successCallback) { final body = {"PatientID": patientID}; - locator().post(WIFI_CREDENTIALS, body: body, - onSuccess: (dynamic response, int statusCode) { - print(response); - var data = response["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"]; - if (data is List && data.first != null) { - final username = data.first['UserName']; - final password = data.first['Password']; - if (username != null && - password != null && - username.isNotEmpty && - password.isNotEmpty) { - successCallback(username, password); + locator().post( + WIFI_CREDENTIALS, + body: body, + onSuccess: (dynamic response, int statusCode) { + print(response); + var data = response["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"]; + if (data is List && data.first != null) { + final username = data.first['UserName']; + final password = data.first['Password']; + if (username != null && password != null && username.isNotEmpty && password.isNotEmpty) { + successCallback(username, password); + } } - } - }, onFailure: (String error, int statusCode) { - print(error); - }, bypassConnectionCheck: true); + }, + onFailure: (String error, int statusCode) { + print(error); + }, + bypassConnectionCheck: true, + ); } static connectWifi(ProjectViewModel projectViewModel, BuildContext context) { @@ -672,88 +640,80 @@ class Utils { .platformBridge() .connectHMGGuestWifi(GUEST_SSID) .then((value) async { - if (value == 0) { - GifLoaderDialogUtils.hideDialog(context); - } else { - getPatientWifiCredentials(patientID, (username, password) async { - final result = await projectViewModel - .platformBridge() - .connectHMGInternetWifi(PATIENT_SSID, username, password) - .catchError((err) => print(err.toString())); - GifLoaderDialogUtils.hideDialog(context); - if (result == 1) { - // Success + if (value == 0) { + GifLoaderDialogUtils.hideDialog(context); + } else { + getPatientWifiCredentials(patientID, (username, password) async { + final result = await projectViewModel.platformBridge().connectHMGInternetWifi(PATIENT_SSID, username, password).catchError((err) => print(err.toString())); + GifLoaderDialogUtils.hideDialog(context); + if (result == 1) { + // Success + } + }); } + }) + .catchError((e) { + GifLoaderDialogUtils.hideDialog(context); }); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - }); } else { AlertDialogBox( - context: context, - confirmMessage: - "Please login with your account first to use this feature", - okText: "OK", - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - }).showAlertDialog(context); + context: context, + confirmMessage: "Please login with your account first to use this feature", + okText: "OK", + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }, + ).showAlertDialog(context); } }); } - static List myMedicalListHomePage( - {ProjectViewModel? projectViewModel, - BuildContext? context, - bool? isLogin, - count}) { + static List myMedicalListHomePage({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count}) { List medical = []; - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(5) - ? Navigator.push(context!, FadePage(page: MyAppointments())) - : null, - child: isLogin! - ? Stack(children: [ - MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), - projectViewModel.isArabic! - ? !projectViewModel.isLoginChild - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - position: badge_import.BadgePosition.topEnd(), - badgeAnimation: badge_import.BadgeAnimation.fade( - toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 12.0)), - ), - ), - ) - : Container() - : !projectViewModel.isLoginChild + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, + child: isLogin! + ? Stack( + children: [ + MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), + projectViewModel.isArabic! + ? !projectViewModel.isLoginChild + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + position: badge_import.BadgePosition.topEnd(), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text( + count.toString(), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0), + ), + ), + ), + ) + : Container() + : !projectViewModel.isLoginChild ? Positioned( right: 8, top: 4, child: badge_import.Badge( - badgeAnimation: badge_import.BadgeAnimation.fade( - toAnimate: false), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), badgeStyle: badge_import.BadgeStyle( elevation: 0, shape: badge_import.BadgeShape.circle, @@ -763,95 +723,82 @@ class Utils { position: badge_import.BadgePosition.topEnd(), badgeContent: Container( padding: EdgeInsets.all(2.0), - child: Text(count.toString(), - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 12.0)), + child: Text( + count.toString(), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0), + ), ), ), ) : Container(), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context!).myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase.of(context!).myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(10) - ? Navigator.push(context, FadePage(page: LabsHomePage())) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).lab, - imagePath: 'lab_result.svg', - subTitle: TranslationBase.of(context).labSubtitle, - isEnable: projectViewModel.havePrivilege(10), + ], + ) + : MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(7) - ? Navigator.push(context, FadePage(page: RadiologyHomePage())) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, - isEnable: projectViewModel.havePrivilege(7), + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(10) ? Navigator.push(context, FadePage(page: LabsHomePage())) : null, + child: MedicalProfileItem(title: TranslationBase.of(context).lab, imagePath: 'lab_result.svg', subTitle: TranslationBase.of(context).labSubtitle, isEnable: projectViewModel.havePrivilege(10)), ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(12) - ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, - imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase.of(context).medicinesSubtitle, - isEnable: projectViewModel.havePrivilege(12), + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology.svg', + subTitle: TranslationBase.of(context).radiologySubtitle, + isEnable: projectViewModel.havePrivilege(7), + ), ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(6) - ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) - : null, - child: MedicalProfileItem( + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'medicine_prescription.svg', + subTitle: TranslationBase.of(context).medicinesSubtitle, + isEnable: projectViewModel.havePrivilege(12), + ), + ), + ); + + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(6) ? Navigator.push(context, FadePage(page: DoctorHomePage())) : null, + child: MedicalProfileItem( title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, - isEnable: projectViewModel.havePrivilege(6)), - )); + isEnable: projectViewModel.havePrivilege(6), + ), + ), + ); return medical; } - static Widget loadNetworkImage( - {required String url, BoxFit fitting = BoxFit.cover}) { + static Widget loadNetworkImage({required String url, BoxFit fitting = BoxFit.cover}) { return CachedNetworkImage( - placeholderFadeInDuration: Duration(milliseconds: 250), - fit: fitting, - imageUrl: url, - placeholder: (context, url) => - Container(child: Center(child: CircularProgressIndicator())), - errorWidget: (context, url, error) { - return Icon( - Icons.error, - color: Colors.red, - size: 50, - ); - }); + placeholderFadeInDuration: Duration(milliseconds: 250), + fit: fitting, + imageUrl: url, + placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())), + errorWidget: (context, url, error) { + return Icon(Icons.error, color: Colors.red, size: 50); + }, + ); } static bool route(Route route, {required Type equalsTo}) { @@ -862,11 +809,7 @@ class Utils { } static navigateToCartPage() { - Navigator.pushAndRemoveUntil( - locator()!.navigatorKey!.currentContext!, - MaterialPageRoute( - builder: (context) => LandingPagePharmacy(currentTab: 3)), - (Route r) => false); + Navigator.pushAndRemoveUntil(locator()!.navigatorKey!.currentContext!, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route r) => false); } static Widget tableColumnTitle(String text, {bool showDivider = true}) { @@ -878,67 +821,41 @@ class Utils { Text( text, maxLines: 1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - letterSpacing: -0.48, - height: 18 / 12), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), ), SizedBox(height: 5), - if (showDivider) - Divider( - height: 1, - color: Color(0xff2E303A), - thickness: 1, - ) + if (showDivider) Divider(height: 1, color: Color(0xff2E303A), thickness: 1), ], ); } - static Widget tableColumnValue(String text, - {bool isLast = false, - bool isCapitable = true, - ProjectViewModel? mProjectViewModel}) { - ProjectViewModel projectViewModel = - mProjectViewModel ?? Provider.of(AppGlobal.context); + static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel? mProjectViewModel}) { + ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 12), Text( - isCapitable && !projectViewModel.isArabic - ? text.toLowerCase().capitalizeFirstofEach - : text, + isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 2, overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff575757), - letterSpacing: -0.4, - height: 16 / 10), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (!isLast) - Divider( - height: 1, - color: Color(0xffEFEFEF), - thickness: 1, - ) + if (!isLast) Divider(height: 1, color: Color(0xffEFEFEF), thickness: 1), ], ); } static Future isGoogleServicesAvailable() async { - GooglePlayServicesAvailability availability = await GoogleApiAvailability - .instance - .checkGooglePlayServicesAvailability(); - String status = availability.toString().split('.').last; - if (status == "success") { - return true; - } + // GooglePlayServicesAvailability availability = await GoogleApiAvailability + // .instance + // .checkGooglePlayServicesAvailability(); + // String status = availability.toString().split('.').last; + // if (status == "success") { + // return true; + // } return false; } @@ -950,8 +867,7 @@ class Utils { final lat1Radians = _toRadians(lat1); final lat2Radians = _toRadians(lat2); - final a = - _haversin(dLat) + cos(lat1Radians) * cos(lat2Radians) * _haversin(dLon); + final a = _haversin(dLat) + cos(lat1Radians) * cos(lat2Radians) * _haversin(dLon); final c = 2 * asin(sqrt(a)); return r * c; @@ -961,8 +877,7 @@ class Utils { static num _haversin(double radians) => pow(sin(radians / 2), 2); - static Widget tableColumnValueWithUnderLine(String text, - {bool isLast = false, bool isCapitable = true}) { + static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -973,21 +888,10 @@ class Utils { isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 1, minFontSize: 6, - style: TextStyle( - decoration: TextDecoration.underline, - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xffD02127), - letterSpacing: -0.48, - height: 18 / 12), + style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), ), SizedBox(height: 10), - if (!isLast) - Divider( - height: 1, - color: Color(0xffEFEFEF), - thickness: 1, - ) + if (!isLast) Divider(height: 1, color: Color(0xffEFEFEF), thickness: 1), ], ); } @@ -996,8 +900,7 @@ class Utils { return crypto.md5.convert(utf8.encode(input)).toString(); } - static bool isVidaPlusProject( - ProjectViewModel projectViewModel, int projectID) { + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { bool isVidaPlus = false; projectViewModel.vidaPlusProjectList.forEach((element) { if (element.projectID == projectID) { @@ -1017,8 +920,7 @@ class Utils { return isHMCProject; } - static ProjectDetailListModel getProjectDetailObj( - ProjectViewModel projectViewModel, int projectID) { + static ProjectDetailListModel getProjectDetailObj(ProjectViewModel projectViewModel, int projectID) { ProjectDetailListModel projectDetailListModel = ProjectDetailListModel(); projectViewModel.projectDetailListModel.forEach((element) { if (element.projectID == projectID) { @@ -1028,16 +930,10 @@ class Utils { return projectDetailListModel; } -//static String generateSignature() {} + //static String generateSignature() {} } -Widget applyShadow( - {Color color = Colors.grey, - double shadowOpacity = 0.5, - double spreadRadius = 2, - double blurRadius = 7, - Offset offset = const Offset(2, 2), - required Widget child}) { +Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) { return Container( decoration: BoxDecoration( boxShadow: [ @@ -1054,8 +950,7 @@ Widget applyShadow( } Future userData() async { - var userData = AuthenticatedUser.fromJson( - await AppSharedPreferences().getObject(MAIN_USER)); + var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER)); return userData; } @@ -1067,13 +962,9 @@ extension IndexedIterable on Iterable { } } -openAppStore( - {String? androidPackageName, - String? iOSAppID, - bool isHuawei = false}) async { +openAppStore({String? androidPackageName, String? iOSAppID, bool isHuawei = false}) async { if (Platform.isAndroid) { - assert(!(androidPackageName == null), - "Should have valid value in androidPackageName parameter"); + assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); if (isHuawei) { launchUrl(Uri.parse("appmarket://details?id=com.ejada.hmg")); } else { @@ -1081,8 +972,7 @@ openAppStore( } } else if (Platform.isIOS) { assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); - launchUrl( - Uri.parse("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)")); + launchUrl(Uri.parse("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)")); } } @@ -1105,11 +995,7 @@ String labelFrom({required String className}) { extension StringExtension on String { String capitalize() { - return this.splitMapJoin(RegExp(r'\w+'), - onMatch: (m) => - '${m.group(0)}'.substring(0, 1).toUpperCase() + - '${m.group(0)}'.substring(1).toLowerCase(), - onNonMatch: (n) => ' '); + return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' '); } } diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index 7ca49939..8a52a828 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -21,7 +21,7 @@ class _GifLoaderContainerState extends State with TickerProv WidgetsBinding.instance.addPostFrameCallback((_) { try { - controller = GifController(autoPlay: true, onFinish: () {}, loop: true); + controller = GifController(); // controller.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); } catch (ex) {} }); diff --git a/lib/widgets/LoadingButton.dart b/lib/widgets/LoadingButton.dart index 8f94cdde..e48b987a 100644 --- a/lib/widgets/LoadingButton.dart +++ b/lib/widgets/LoadingButton.dart @@ -26,8 +26,7 @@ class AnimatedButton extends StatefulWidget { _AnimatedButtonState createState() => _AnimatedButtonState(); } -class _AnimatedButtonState extends State - with SingleTickerProviderStateMixin { +class _AnimatedButtonState extends State with SingleTickerProviderStateMixin { late Animation _sizeAnimation; late Animation _textOpacityAnimation; late Animation _buttonOpacityAnimation; @@ -59,20 +58,16 @@ class _AnimatedButtonState extends State // _colorAnimation // _width, _sizeAnimation - _buttonOpacityAnimation = - Tween(begin: 1.0, end: 0.0).animate(CurvedAnimation( + _buttonOpacityAnimation = Tween(begin: 1.0, end: 0.0).animate(CurvedAnimation( parent: widget.controller, curve: Threshold(.65), )); - _ringThicknessAnimation = - Tween(begin: _loadingCircleRadius, end: _loadingCircleThickness) - .animate(CurvedAnimation( + _ringThicknessAnimation = Tween(begin: _loadingCircleRadius, end: _loadingCircleThickness).animate(CurvedAnimation( parent: widget.controller, curve: Interval(.65, .85), )); - _ringOpacityAnimation = - Tween(begin: 1.0, end: 0.0).animate(CurvedAnimation( + _ringOpacityAnimation = Tween(begin: 1.0, end: 0.0).animate(CurvedAnimation( parent: widget.controller, curve: Interval(.85, 1.0), )); @@ -95,7 +90,6 @@ class _AnimatedButtonState extends State _loadingColor = widget.loadingColor ?? theme.colorScheme.secondary; _colorAnimation = ColorTween( - begin: _color, end: _loadingColor, ).animate( @@ -110,8 +104,7 @@ class _AnimatedButtonState extends State void didUpdateWidget(AnimatedButton oldWidget) { super.didUpdateWidget(oldWidget); - if (oldWidget.color != widget.color || - oldWidget.loadingColor != widget.loadingColor) { + if (oldWidget.color != widget.color || oldWidget.loadingColor != widget.loadingColor) { _updateColorAnimation(); } @@ -138,25 +131,39 @@ class _AnimatedButtonState extends State /// sets width and size animation void _updateWidth() { final theme = Theme.of(context); - final fontSize = theme.textTheme.button!.fontSize; + final textStyle = theme.textTheme.labelLarge ?? const TextStyle(fontSize: 14); + final fontSize = textStyle.fontSize ?? 14.0; final renderParagraph = RenderParagraph( TextSpan( text: widget.text, style: TextStyle( fontSize: fontSize, - fontWeight: theme.textTheme.button!.fontWeight, - letterSpacing: theme.textTheme.button!.letterSpacing, + fontWeight: textStyle.fontWeight, + letterSpacing: textStyle.letterSpacing, ), ), textDirection: TextDirection.ltr, maxLines: 1, ); + // final theme = Theme.of(context); + // final fontSize = theme.textTheme.button!.fontSize; + // final renderParagraph = RenderParagraph( + // TextSpan( + // text: widget.text, + // style: TextStyle( + // fontSize: fontSize, + // fontWeight: theme.textTheme.button!.fontWeight, + // letterSpacing: theme.textTheme.button!.letterSpacing, + // ), + // ), + // textDirection: TextDirection.ltr, + // maxLines: 1, + // ); renderParagraph.layout(BoxConstraints(minWidth: 120.0)); // text width based on fontSize, plus 45.0 for padding - var textWidth = - renderParagraph.getMinIntrinsicWidth(fontSize!).ceilToDouble() + 45.0; + var textWidth = renderParagraph.getMinIntrinsicWidth(fontSize!).ceilToDouble() + 45.0; // button width is min 120.0 and max 240.0 _width = textWidth > 120.0 && textWidth < 240.0 @@ -165,8 +172,7 @@ class _AnimatedButtonState extends State ? 240.0 : 120.0; - _sizeAnimation = Tween(begin: 1.0, end: _height / _width) - .animate(CurvedAnimation( + _sizeAnimation = Tween(begin: 1.0, end: _height / _width).animate(CurvedAnimation( parent: widget.controller, curve: Interval(0.0, .65, curve: Curves.fastOutSlowIn), )); @@ -192,16 +198,11 @@ class _AnimatedButtonState extends State child: AnimatedBuilder( animation: _colorAnimation, builder: (context, child) => Material( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(_height / 2)), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(_height / 2)), color: _colorAnimation.value, child: child, shadowColor: _color, - elevation: (_isLoading == false) - ? (_hover == true - ? buttonTheme.highlightElevation ?? 0.0 - : buttonTheme.elevation ?? 0.0) - : 0.0, + elevation: (_isLoading == false) ? (_hover == true ? buttonTheme.highlightElevation ?? 0.0 : buttonTheme.elevation ?? 0.0) : 0.0, ), child: InkWell( onTap: !_isLoading ? widget!.onPressed : null, @@ -309,8 +310,7 @@ class AnimatedText extends StatefulWidget { _AnimatedTextState createState() => _AnimatedTextState(); } -class _AnimatedTextState extends State - with SingleTickerProviderStateMixin { +class _AnimatedTextState extends State with SingleTickerProviderStateMixin { var _newText = ''; var _oldText = ''; var _layoutHeight = 0.0; @@ -435,17 +435,13 @@ class _AnimatedTextState extends State if (_animation.value <= toRadian(85)) Transform( alignment: Alignment.center, - transform: rollUp - ? _getFrontSideUp(_animation.value) - : _getFrontSideDown(_animation.value), + transform: rollUp ? _getFrontSideUp(_animation.value) : _getFrontSideDown(_animation.value), child: oldText, ), if (_animation.value >= toRadian(5)) Transform( alignment: Alignment.center, - transform: rollUp - ? _getBackSideUp(_animation.value) - : _getBackSideDown(_animation.value), + transform: rollUp ? _getBackSideUp(_animation.value) : _getBackSideDown(_animation.value), child: newText, ), ], @@ -456,8 +452,7 @@ class _AnimatedTextState extends State // Helpers double toRadian(double degree) => degree * pi / 180; - double lerp(double start, double end, double percent) => - (start + percent * (end - start)); + double lerp(double start, double end, double percent) => (start + percent * (end - start)); Size? getWidgetSize(GlobalKey key) { return key.currentContext!.size; diff --git a/lib/widgets/app_map/google_huawei_map.dart b/lib/widgets/app_map/google_huawei_map.dart index fdd7c739..ee2d98bf 100644 --- a/lib/widgets/app_map/google_huawei_map.dart +++ b/lib/widgets/app_map/google_huawei_map.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as googlemap; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; -import 'package:huawei_map/huawei_map.dart' as hmsMap; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_map/huawei_map.dart' as hmsMap; class AppMap extends StatefulWidget { late dynamic onCameraMove; @@ -26,9 +26,9 @@ class AppMap extends StatefulWidget { moveTo({required googlemap.CameraPosition cameraPostion}) { if (_state!.isHuawei) { final cameraJson = cameraPostion.toMap(); - final camera = hmsMap.CameraPosition.fromMap(cameraJson); - _state?._huaweiMapController - .animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); + // final camera = hmsMap.CameraPosition.fromMap(cameraJson); + // _state?._huaweiMapController + // .animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); } else { _state?.googleMapController.animateCamera( googlemap.CameraUpdate.newCameraPosition( @@ -44,23 +44,23 @@ class AppMapState extends State { Completer(); late googlemap.GoogleMapController googleMapController; - Completer _huaweiMapControllerComp = Completer(); - late hmsMap.HuaweiMapController _huaweiMapController; - - late HmsApiAvailability hmsApiAvailability; - - checkIsHuawei() async { - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - hmsMap.HuaweiMapInitializer.initializeMap(); - }); - print(isHuawei); - setState(() {}); + // Completer _huaweiMapControllerComp = Completer(); + // late hmsMap.HuaweiMapController _huaweiMapController; + // + // late HmsApiAvailability hmsApiAvailability; + + checkIsHuawei() async { + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // hmsMap.HuaweiMapInitializer.initializeMap(); + // }); + // print(isHuawei); + // setState(() {}); } @override void initState() { - hmsApiAvailability = HmsApiAvailability(); + // hmsApiAvailability = HmsApiAvailability(); if (Platform.isAndroid) checkIsHuawei(); super.initState(); } @@ -97,23 +97,24 @@ class AppMapState extends State { } Widget huaweiMap() { - return hmsMap.HuaweiMap( - mapType: hmsMap.MapType.normal, - zoomControlsEnabled: false, - myLocationButtonEnabled: true, - myLocationEnabled: true, - initialCameraPosition: - hmsMap.CameraPosition.fromMap(widget.initialCamera), - onCameraMove: (camera) => widget.onCameraMove!, - onMapCreated: (controller) { - _huaweiMapController = controller; - _huaweiMapControllerComp.complete(controller); - widget.onMapCreated!(); - }, - onCameraIdle: () { - print("onCameraIdle"); - widget.onCameraIdle!(); - }, - ); + return SizedBox(); + // return hmsMap.HuaweiMap( + // mapType: hmsMap.MapType.normal, + // zoomControlsEnabled: false, + // myLocationButtonEnabled: true, + // myLocationEnabled: true, + // initialCameraPosition: + // hmsMap.CameraPosition.fromMap(widget.initialCamera), + // onCameraMove: (camera) => widget.onCameraMove!, + // onMapCreated: (controller) { + // _huaweiMapController = controller; + // _huaweiMapControllerComp.complete(controller); + // widget.onMapCreated!(); + // }, + // onCameraIdle: () { + // print("onCameraIdle"); + // widget.onCameraIdle!(); + // }, + // ); } } diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 3a49f3d8..ef6ae360 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -122,7 +122,7 @@ class _BottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: EdgeInsets.symmetric(vertical: 12.0), - decoration: BoxDecoration(color: Theme.of(context).backgroundColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), + decoration: BoxDecoration(color: Theme.of(context).colorScheme.background, borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), child: SafeArea( top: false, child: Column( @@ -165,14 +165,14 @@ class _BottomSheetItem extends StatelessWidget { if (icon != null) Icon( icon, - color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : Theme.of(context).primaryColor, + color: color == ITEM_COLOR.error ? Theme.of(context).colorScheme.error : Theme.of(context).primaryColor, size: 18.0, ), if (icon != null) SizedBox(width: 24.0), Texts( title ?? "", style: "bodyText2", - color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : null, + color: color == ITEM_COLOR.error ? Theme.of(context).colorScheme.error : null, ), ], ), diff --git a/lib/widgets/buttons/BottomButton.dart b/lib/widgets/buttons/BottomButton.dart index f4aafdb4..c2e1d6a4 100644 --- a/lib/widgets/buttons/BottomButton.dart +++ b/lib/widgets/buttons/BottomButton.dart @@ -52,8 +52,8 @@ class BottomButton extends StatelessWidget { 0.9 ], colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0) + Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.background.withOpacity(0) ]), ), alignment: Alignment.center, @@ -70,7 +70,7 @@ class BottomButton extends StatelessWidget { left: 30.0, right: 30.0, top: 14.0, bottom: 14), decoration: BoxDecoration( color: child != null - ? Theme.of(context).backgroundColor + ? Theme.of(context).colorScheme.background : null, border: child != null ? Border.all( diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 3128734f..1aaaa176 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -101,7 +101,7 @@ class ShowChart extends StatelessWidget { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 8f374ca3..a22cff35 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -33,7 +33,7 @@ class FlexibleContainer extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Material( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, child: Container( padding: padding, width: double.infinity, diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index 8d7ebda5..fceb9ee8 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -74,7 +74,7 @@ class LineChartCurvedState extends State { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.white, + // tooltipBgColor: Colors.white, ), touchCallback: (touchEvent, LineTouchResponse? touchResponse) {}, handleBuiltInTouches: true, diff --git a/lib/widgets/data_display/services)contaniner.dart b/lib/widgets/data_display/services)contaniner.dart index e18507f4..3f146b08 100644 --- a/lib/widgets/data_display/services)contaniner.dart +++ b/lib/widgets/data_display/services)contaniner.dart @@ -15,7 +15,7 @@ class ServicesContainer extends StatelessWidget { height: 60, margin: EdgeInsets.all(8), decoration: BoxDecoration( - color: Theme.of(context).textTheme.headline2!.color, + color: Theme.of(context).textTheme.displayMedium!.color, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 498e5e48..14cedacd 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -171,30 +171,34 @@ class _TextsState extends State { ProjectViewModel projectViewModel = Provider.of(context); TextStyle? _getFontStyle() { switch (widget.style) { - case "headline2": - return Theme.of(context).textTheme.headline2; - case "headline3": - return Theme.of(context).textTheme.headline3; - case "headline4": - return Theme.of(context).textTheme.headline4; - case "headline5": - return Theme.of(context).textTheme.headline5; - case "headline6": - return Theme.of(context).textTheme.headline6; - case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + case "headlineLarge": + return Theme.of(context).textTheme.headlineLarge; + case "headlineMedium": + return Theme.of(context).textTheme.headlineMedium; + case "headlineSmall": + return Theme.of(context).textTheme.headlineSmall; + case "titleLarge": + return Theme.of(context).textTheme.titleLarge; + case "titleMedium": + return Theme.of(context).textTheme.titleMedium; + case "titleSmall": + return Theme.of(context).textTheme.titleSmall; + case "bodyLarge": + return Theme.of(context).textTheme.bodyLarge; + case "bodyMedium": + return Theme.of(context).textTheme.bodyMedium; + case "bodySmall": + return Theme.of(context).textTheme.bodySmall; + case "labelLarge": + return Theme.of(context).textTheme.labelLarge; + case "labelMedium": + return Theme.of(context).textTheme.labelMedium; + case "labelSmall": + return Theme.of(context).textTheme.labelSmall; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); - case "bodyText1": - return Theme.of(context).textTheme.bodyText1; - case "caption": - return Theme.of(context).textTheme.caption; - case "overline": - return Theme.of(context).textTheme.overline; - case "button": - return Theme.of(context).textTheme.button; + return Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: 15.0); default: - return TextStyle(); + return const TextStyle(); } } @@ -224,7 +228,7 @@ class _TextsState extends State { fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color - : Theme.of(context).textTheme.bodyText1!.color, + : Theme.of(context).textTheme.bodyLarge!.color, fontWeight: widget.fontWeight ?? _getFontWeight(), ) : TextStyle( @@ -232,7 +236,7 @@ class _TextsState extends State { decoration: widget.decoration, fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color ?? - Theme.of(context).textTheme.bodyText1!.color, + Theme.of(context).textTheme.bodyLarge!.color, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), @@ -247,8 +251,8 @@ class _TextsState extends State { child: Container( decoration: BoxDecoration( gradient: LinearGradient(colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), + Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.background.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter), ), height: 30.0, diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index af0d81e9..eea8655a 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -52,7 +52,7 @@ class _DrawerItemState extends State { ? widget.icon : Icon( widget.icon, - color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1?.color : widget.iconColor, + color: widget.iconColor == null ? Theme.of(context).textTheme.bodyLarge?.color : widget.iconColor, size: SizeConfig.imageSizeMultiplier! * 5, )), Expanded( diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 9ffec736..54cbfc1b 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -138,7 +138,7 @@ class MyInAppBrowser extends InAppBrowser { openPackagesPaymentBrowser({required int customer_id, required int order_id}) { paymentType = _PAYMENT_TYPE.PACKAGES; var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; - this.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(full_url)), options: _InAppBrowserOptions); + this.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(full_url))), options: _InAppBrowserOptions); } openPaymentBrowser(num amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID, @@ -190,7 +190,7 @@ class MyInAppBrowser extends InAppBrowser { String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod // String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); + this.browser.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(url))), options: _InAppBrowserOptions); }).catchError((err) { print(err); if (context != null) GifLoaderDialogUtils.hideDialog(context); @@ -233,7 +233,7 @@ class MyInAppBrowser extends InAppBrowser { appoNo, clinicID, doctorID, "", installments) .then((value) { paymentType = _PAYMENT_TYPE.PATIENT; - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); + this.browser.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(value))), options: _InAppBrowserOptions); }); }).catchError((err) { print(err); @@ -245,7 +245,7 @@ class MyInAppBrowser extends InAppBrowser { clinicID, doctorID) .then((value) { paymentType = _PAYMENT_TYPE.PATIENT; - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); + this.browser.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(value))), options: _InAppBrowserOptions); }); } } @@ -258,16 +258,16 @@ class MyInAppBrowser extends InAppBrowser { // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { if (order.customValuesXml!.contains("ApplePay")) { - safariBrowser.open(url: Uri.parse(value)); + safariBrowser.open(url: WebUri.uri(Uri.parse(value))); } else { - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); + this.browser.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(value))), options: _InAppBrowserOptions); } }); } openBrowser(String url) { this.browser = browser; - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); + this.browser.openUrlRequest(urlRequest: URLRequest(url: WebUri.uri(Uri.parse(url))), options: _InAppBrowserOptions); } Future generateURL(num amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID, @@ -488,8 +488,14 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser { print("ChromeSafari browser opened"); } + // @override + // void onCompletedInitialLoad() { + // print("ChromeSafari browser initial load completed"); + // onLoadStartCallback!("ApplePay"); + // } + @override - void onCompletedInitialLoad() { + void onCompletedInitialLoad(bool? didLoadSuccessfully) { print("ChromeSafari browser initial load completed"); onLoadStartCallback!("ApplePay"); } diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index be6c9989..7412aba2 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -236,7 +236,7 @@ class _TextFieldsState extends State { onSaved: widget.onSaved, style: Theme.of(context) .textTheme - .bodyText1! + .bodyLarge! .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ @@ -260,7 +260,7 @@ class _TextFieldsState extends State { filled: true, fillColor: widget.bare! ? Colors.transparent - : Theme.of(context).backgroundColor, + : Theme.of(context).colorScheme.background, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( @@ -270,14 +270,14 @@ class _TextFieldsState extends State { errorBorder: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context) - .errorColor + .colorScheme.error .withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context) - .errorColor + .colorScheme.error .withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 883e2de3..57700703 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -494,7 +494,7 @@ class AppBarWidgetState extends State { // headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), // ), title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle!.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, - style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.bodyLarge!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack( diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 1bd53b62..089a4a11 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -321,7 +321,7 @@ class _NotAutPageState extends State { loginCheck(context); }, label: TranslationBase.of(context).serviceInformationButton, - textColor: Theme.of(context).backgroundColor), + textColor: Theme.of(context).colorScheme.background), ), ], ), diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 405bb1c0..e459fea3 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -212,12 +212,12 @@ class SMSOTP { errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index 2f2276ae..f836f9fb 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -14,8 +14,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as googleMap; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class PickupLocationFromMap extends StatefulWidget { @@ -41,7 +40,7 @@ class _PickupLocationFromMapState extends State { double latitude = 0; double longitude = 0; - late HmsApiAvailability hmsApiAvailability; + // late HmsApiAvailability hmsApiAvailability; static CameraPosition kGooglePlex = CameraPosition( target: LatLng(24.126613,45.081137), @@ -51,7 +50,7 @@ class _PickupLocationFromMapState extends State { @override void initState() { if(Platform.isAndroid) { - hmsApiAvailability = HmsApiAvailability(); + // hmsApiAvailability = HmsApiAvailability(); checkIsHuawei(); } @@ -80,10 +79,10 @@ class _PickupLocationFromMapState extends State { // isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable; // print(isHuawei); // setState(() {}); - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); setState(() {}); } @@ -127,54 +126,55 @@ class _PickupLocationFromMapState extends State { ), ], ) - : PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - selectInitialPosition: true, - region: "SA", - onPlacePicked: (PickResult result) { - LocationDetails locationDetails = new LocationDetails(); - locationDetails.lat = latitude; - locationDetails.long = longitude; - locationDetails.formattedAddress = result.formattedAddress!; - print(result.adrAddress); - widget.onPick!(locationDetails); - Navigator.of(context).pop(); - }, - selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: DefaultButton( - TranslationBase.of(context).next, - () { - LocationDetails locationDetails = new LocationDetails(); - locationDetails.lat = selectedPlace!.geometry!.location.lat; - locationDetails.long = selectedPlace.geometry!.location.lng; - locationDetails.formattedAddress = selectedPlace.formattedAddress!; - widget.onPick!(locationDetails); - Navigator.of(context).pop(); - }, - ), - ), - ); - }, - initialPosition: googleMap.LatLng(projectViewModel.latitude, projectViewModel.longitude), - useCurrentLocation: true, - ), + : SizedBox() + // : PlacePicker( + // apiKey: GOOGLE_API_KEY, + // enableMyLocationButton: true, + // automaticallyImplyAppBarLeading: false, + // autocompleteLanguage: projectViewModel.currentLanguage, + // enableMapTypeButton: true, + // selectInitialPosition: true, + // region: "SA", + // onPlacePicked: (PickResult result) { + // LocationDetails locationDetails = new LocationDetails(); + // locationDetails.lat = latitude; + // locationDetails.long = longitude; + // locationDetails.formattedAddress = result.formattedAddress!; + // print(result.adrAddress); + // widget.onPick!(locationDetails); + // Navigator.of(context).pop(); + // }, + // selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { + // print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + // return isSearchBarFocused + // ? Container() + // : FloatingCard( + // bottomPosition: 0.0, + // leftPosition: 0.0, + // rightPosition: 0.0, + // width: 500, + // borderRadius: BorderRadius.circular(12.0), + // child: state == SearchingState.Searching + // ? Center(child: CircularProgressIndicator()) + // : Container( + // margin: EdgeInsets.all(12), + // child: DefaultButton( + // TranslationBase.of(context).next, + // () { + // LocationDetails locationDetails = new LocationDetails(); + // locationDetails.lat = selectedPlace!.geometry!.location.lat; + // locationDetails.long = selectedPlace.geometry!.location.lng; + // locationDetails.formattedAddress = selectedPlace.formattedAddress!; + // widget.onPick!(locationDetails); + // Navigator.of(context).pop(); + // }, + // ), + // ), + // ); + // }, + // initialPosition: googleMap.LatLng(projectViewModel.latitude, projectViewModel.longitude), + // useCurrentLocation: true, + // ), ); } diff --git a/lib/widgets/text/app_texts_widget.dart b/lib/widgets/text/app_texts_widget.dart index 01dce651..2869653e 100644 --- a/lib/widgets/text/app_texts_widget.dart +++ b/lib/widgets/text/app_texts_widget.dart @@ -62,7 +62,7 @@ class _AppTextState extends State { overflow: TextOverflow.clip, style: TextStyle( - color: widget.color == null ? Theme.of(context).textTheme.bodyText1!.color : widget.color, + color: widget.color == null ? Theme.of(context).textTheme.bodyLarge!.color : widget.color, fontWeight: widget.fontWeight, fontSize: widget.fontSize ?? (SizeConfig.textMultiplier! * 2), height: widget.height, diff --git a/pubspec.yaml b/pubspec.yaml index fe0147c1..1f408153 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,81 +1,66 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 1.0.0+1 +version: 1.0.1+1 environment: - sdk: ">=3.0.0 <3.13.0" + # sdk: ">=3.0.0 <3.13.0" + sdk: ^3.8.1 + dependencies: flutter: sdk: flutter + + # Localizations flutter_localizations: sdk: flutter - intl: ^0.18.1 - - webview_flutter: ^2.0.4 - - # http client - http: ^0.13.4 - #connectivity: ^3.0.6 - connectivity_plus: ^5.0.1 - async: ^2.8.1 - - audio_wave: ^0.1.4 - # audio_session: ^0.1.13 - # State Management - provider: ^6.0.5 - - #Dependency Injection - get_it: ^7.2.0 - - #Google Fit & Apple HealthKit - health: ^3.0.3 - - #chart - fl_chart: ^0.64.0 - - - #Camera Preview - camera: ^0.10.1 + webview_flutter: ^4.13.0 + connectivity_plus: ^6.1.4 + async: ^2.13.0 + audio_wave: ^0.1.5 + provider: ^6.1.5 + get_it: ^8.0.3 + fl_chart: ^1.0.0 + # camera: ^0.11.1 # Permissions - permission_handler: ^11.1.0 + permission_handler: ^12.0.0+1 # Flutter Html View - flutter_html: ^3.0.0-beta.2 + flutter_html: ^3.0.0 # Pagnation pull_to_refresh: ^2.0.0 # Native - local_auth: ^2.1.7 - localstorage: ^4.0.0+1 - maps_launcher: ^2.0.1 - url_launcher: ^6.0.15 - shared_preferences: ^2.0.0 + local_auth: ^2.3.0 + localstorage: ^6.0.0 + maps_launcher: ^3.0.0+1 + url_launcher: ^6.3.1 + shared_preferences: ^2.5.3 # flutter_flexible_toast: ^0.1.4 - fluttertoast: ^8.0.8 - firebase_messaging: 14.1.0 - firebase_analytics: ^10.0.5 + fluttertoast: ^8.2.12 + firebase_messaging: ^15.2.7 + firebase_analytics: ^11.5.0 # Progress bar flutter_progress_hud: ^2.0.2 - percent_indicator: ^4.2.3 + percent_indicator: ^4.2.5 # Icons - font_awesome_flutter: any - cupertino_icons: ^1.0.0 + font_awesome_flutter: 10.8.0 + cupertino_icons: ^1.0.8 # Image Attachments - image_picker: ^1.0.4 + image_picker: ^1.1.2 #GIF image # flutter_gifimage: ^1.0.1 #flutter_gif: any photo_view: any - gif_view: ^0.3.1 + gif_view: any # flutter_webrtc: any # UI Reqs @@ -86,18 +71,26 @@ dependencies: google_maps_flutter: ^2.1.1 # Huawei - huawei_map: ^6.11.0+304 - huawei_push: ^6.5.0+300 +# huawei_map: ^6.11.2+304 +# huawei_push: ^6.12.0+303 +# huawei_map: +# git: +# url: https://github.com/fleoparra/hms-flutter-plugin.git +# path: flutter-hms-map +# huawei_push: +# git: +# url: https://github.com/crasowas/hms-flutter-plugin.git +# path: flutter-hms-push # Qr code Scanner TODO fix it - location: ^5.0.3 - barcode_scan2: ^4.2.2 + location: ^8.0.0 + barcode_scan2: any # Rating Stars flutter_rating_bar: ^4.0.1 # Calendar - syncfusion_flutter_calendar: ^23.1.42 + # SVG Images flutter_svg: ^2.0.8 @@ -106,13 +99,13 @@ dependencies: manage_calendar_events: ^2.0.3 #InAppBrowser - flutter_inappwebview: ^5.8.0 + flutter_inappwebview: ^6.1.5 #Circular progress bar for reverse timer circular_countdown_timer: ^0.2.0 #Just Audio to play ringing for incoming video call - just_audio: ^0.9.30 + just_audio: ^0.10.4 #hijri hijri: ^3.0.0 @@ -121,66 +114,78 @@ dependencies: flutter_datetime_picker_plus: ^2.1.0 carousel_pro_nullsafety: ^2.0.0 flutter_local_notifications: any - device_calendar: ^4.3.2 - geolocator: ^9.0.2 - geocoding: ^2.0.1 + + # timezone: ^0.10.0 + + # geolocator: ^9.0.2 + geolocator: any + geocoding: ^4.0.0 jiffy: ^6.2.1 #Flutter WebRTC #flutter_webrtc: ^0.9.7 - screen_brightness: ^0.2.2+1 - google_maps_place_picker_mb: ^3.0.0 + screen_brightness: ^2.1.4 + map_launcher: ^3.0.1 flutter_countdown_timer: ^4.1.0 #Dependencies for video call implementation - native_device_orientation: ^1.0.0 - wakelock: ^0.6.2 + native_device_orientation: ^2.0.3 + # wakelock: ^0.6.2 after_layout: ^1.1.0 cached_network_image: ^3.3.0 - flutter_tts: ^3.6.1 - vibration: ^1.7.3 + flutter_tts: ^4.2.3 + vibration: ^3.1.3 flutter_nfc_kit: ^3.3.1 #geofencing: any - speech_to_text: ^6.1.1 + speech_to_text: ^7.0.0 in_app_update: ^4.2.2 in_app_review: ^2.0.3 badges: ^3.1.2 - flutter_app_icon_badge: ^2.0.0 -# dropdown_search: 5.0.6 - youtube_player_flutter: ^8.1.2 - -# shimmer: ^3.0.0 - carousel_slider: ^4.0.0 -# flutter_staggered_grid_view: ^0.7.0 - huawei_hmsavailability: ^6.11.0+301 - huawei_location: ^6.11.0+301 - share_plus: ^6.3.4 + app_badge_plus: ^1.2.3 + # dropdown_search: 5.0.6 + youtube_player_flutter: ^9.1.1 + + # shimmer: ^3.0.0 + carousel_slider: ^5.1.1 + # flutter_staggered_grid_view: ^0.7.0 +# huawei_hmsavailability: ^6.11.0+301 +# huawei_location: ^6.11.0+301 + share_plus: any # Marker Animation auto_size_text: ^3.0.0 equatable: ^2.0.3 wave: ^0.2.0 - sms_otp_auto_verify: ^2.1.0 -# flutter_ios_voip_kit: ^0.1.0 - google_api_availability: ^5.0.0 + sms_otp_auto_verify: ^2.2.0 open_filex: ^4.3.2 path_provider: ^2.0.8 - amazon_payfort: ^1.1.0 - logger: ^2.0.2+1 + amazon_payfort: ^1.1.4 + # logger: ^2.0.2+1 network_info_plus: any + # win32: any + + + + + google_api_headers: ^4.5.3 + syncfusion_flutter_calendar: ^29.2.11 + device_calendar: ^4.0.3 + http: ^1.4.0 +# web: 1.1.1 + - flutter_zoom_videosdk: ^1.10.11 - dart_jsonwebtoken: ^2.14.0 dependency_overrides: + timezone: ^0.10.1 + + + dev_dependencies: flutter_test: sdk: flutter - build_runner: ^2.1.5 - flutter: uses-material-design: true