"Added error handling and loading indicators to media and AI API services, updated media service to handle file picking and loading, and modified audio wave and AI message bar widgets to handle audio playback and file attachments."

This commit is contained in:
Amir Hossein Mousavi 2024-09-11 11:59:44 +03:30
parent 62b61bec6b
commit 01566ce45d
9 changed files with 282 additions and 215 deletions

View File

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '12.0' platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View File

@ -1,59 +1,67 @@
PODS: PODS:
- assets_audio_player (0.0.1): - audio_session (0.0.1):
- Flutter
- assets_audio_player_web (0.0.1):
- Flutter - Flutter
- awesome_notifications (0.8.1): - awesome_notifications (0.8.1):
- Flutter - Flutter
- IosAwnCore (~> 0.8.0) - IosAwnCore (~> 0.8.0)
- awesome_notifications_core (0.0.1): - DKImagePickerController/Core (4.3.9):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.9)
- DKImagePickerController/PhotoGallery (4.3.9):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.9)
- DKPhotoGallery (0.0.19):
- DKPhotoGallery/Core (= 0.0.19)
- DKPhotoGallery/Model (= 0.0.19)
- DKPhotoGallery/Preview (= 0.0.19)
- DKPhotoGallery/Resource (= 0.0.19)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.19):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.19):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter - Flutter
- better_player (0.0.1): - Firebase/CoreOnly (10.29.0):
- Cache (~> 6.0.0) - FirebaseCore (= 10.29.0)
- Firebase/Messaging (10.29.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.29.0)
- firebase_core (3.3.0):
- Firebase/CoreOnly (= 10.29.0)
- Flutter - Flutter
- GCDWebServer - firebase_messaging (15.0.4):
- HLSCachingReverseProxyServer - Firebase/Messaging (= 10.29.0)
- PINCache
- Cache (6.0.0)
- Firebase/Auth (10.25.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 10.25.0)
- Firebase/CoreOnly (10.25.0):
- FirebaseCore (= 10.25.0)
- Firebase/Messaging (10.25.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.25.0)
- firebase_auth (4.19.6):
- Firebase/Auth (= 10.25.0)
- firebase_core - firebase_core
- Flutter - Flutter
- firebase_core (2.31.1): - FirebaseCore (10.29.0):
- Firebase/CoreOnly (= 10.25.0)
- Flutter
- firebase_messaging (14.9.2):
- Firebase/Messaging (= 10.25.0)
- firebase_core
- Flutter
- FirebaseAppCheckInterop (10.25.0)
- FirebaseAuth (10.25.0):
- FirebaseAppCheckInterop (~> 10.17)
- FirebaseCore (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- GoogleUtilities/Environment (~> 7.8)
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
- RecaptchaInterop (~> 100.0)
- FirebaseCore (10.25.0):
- FirebaseCoreInternal (~> 10.0) - FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12) - GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.25.0): - FirebaseCoreInternal (10.29.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)" - "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.25.0): - FirebaseInstallations (10.29.0):
- FirebaseCore (~> 10.0) - FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1) - PromisesObjC (~> 2.1)
- FirebaseMessaging (10.25.0): - FirebaseMessaging (10.29.0):
- FirebaseCore (~> 10.0) - FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0) - FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.3) - GoogleDataTransport (~> 9.3)
@ -63,15 +71,10 @@ PODS:
- GoogleUtilities/UserDefaults (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8)
- nanopb (< 2.30911.0, >= 2.30908.0) - nanopb (< 2.30911.0, >= 2.30908.0)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0): - flutter_secure_storage (6.0.0):
- Flutter - Flutter
- flutter_vibrate (0.0.1): - flutter_vibrate (0.0.1):
- Flutter - Flutter
- GCDWebServer (3.5.4):
- GCDWebServer/Core (= 3.5.4)
- GCDWebServer/Core (3.5.4)
- GoogleDataTransport (9.4.1): - GoogleDataTransport (9.4.1):
- GoogleUtilities/Environment (~> 7.7) - GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30911.0, >= 2.30908.0) - nanopb (< 2.30911.0, >= 2.30908.0)
@ -101,10 +104,6 @@ PODS:
- GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/UserDefaults (7.13.3):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GTMSessionFetcher/Core (3.4.1)
- HLSCachingReverseProxyServer (0.1.0):
- GCDWebServer (~> 3.5)
- PINCache (>= 3.0.1-beta.3)
- home_widget (0.0.1): - home_widget (0.0.1):
- Flutter - Flutter
- image_cropper (0.0.4): - image_cropper (0.0.4):
@ -113,110 +112,96 @@ PODS:
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- IosAwnCore (0.8.0) - IosAwnCore (0.8.0)
- just_audio (0.0.1):
- Flutter
- nanopb (2.30910.0): - nanopb (2.30910.0):
- nanopb/decode (= 2.30910.0) - nanopb/decode (= 2.30910.0)
- nanopb/encode (= 2.30910.0) - nanopb/encode (= 2.30910.0)
- nanopb/decode (2.30910.0) - nanopb/decode (2.30910.0)
- nanopb/encode (2.30910.0) - nanopb/encode (2.30910.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- permission_handler_apple (9.3.0): - permission_handler_apple (9.3.0):
- Flutter - Flutter
- PINCache (3.0.4):
- PINCache/Arc-exception-safe (= 3.0.4)
- PINCache/Core (= 3.0.4)
- PINCache/Arc-exception-safe (3.0.4):
- PINCache/Core
- PINCache/Core (3.0.4):
- PINOperation (~> 1.2.3)
- PINOperation (1.2.3)
- PromisesObjC (2.4.0) - PromisesObjC (2.4.0)
- RecaptchaInterop (100.0.0) - record_darwin (1.0.0):
- record (0.0.1):
- Flutter - Flutter
- FlutterMacOS
- rive_common (0.0.1): - rive_common (0.0.1):
- Flutter - Flutter
- SDWebImage (5.19.7):
- SDWebImage/Core (= 5.19.7)
- SDWebImage/Core (5.19.7)
- sqflite (0.0.3): - sqflite (0.0.3):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- SwiftyGif (5.4.5)
- TOCropViewController (2.6.1) - TOCropViewController (2.6.1)
- url_launcher_ios (0.0.1): - video_player_avfoundation (0.0.1):
- Flutter - Flutter
- wakelock (0.0.1): - FlutterMacOS
- wakelock_plus (0.0.1):
- Flutter - Flutter
- webview_flutter_wkwebview (0.0.1): - webview_flutter_wkwebview (0.0.1):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- assets_audio_player (from `.symlinks/plugins/assets_audio_player/ios`) - audio_session (from `.symlinks/plugins/audio_session/ios`)
- assets_audio_player_web (from `.symlinks/plugins/assets_audio_player_web/ios`)
- awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`) - awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
- awesome_notifications_core (from `.symlinks/plugins/awesome_notifications_core/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- better_player (from `.symlinks/plugins/better_player/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`) - flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`)
- home_widget (from `.symlinks/plugins/home_widget/ios`) - home_widget (from `.symlinks/plugins/home_widget/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- record (from `.symlinks/plugins/record/ios`) - record_darwin (from `.symlinks/plugins/record_darwin/ios`)
- rive_common (from `.symlinks/plugins/rive_common/ios`) - rive_common (from `.symlinks/plugins/rive_common/ios`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`) - sqflite (from `.symlinks/plugins/sqflite/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- wakelock (from `.symlinks/plugins/wakelock/ios`) - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- Cache - DKImagePickerController
- DKPhotoGallery
- Firebase - Firebase
- FirebaseAppCheckInterop
- FirebaseAuth
- FirebaseCore - FirebaseCore
- FirebaseCoreInternal - FirebaseCoreInternal
- FirebaseInstallations - FirebaseInstallations
- FirebaseMessaging - FirebaseMessaging
- GCDWebServer
- GoogleDataTransport - GoogleDataTransport
- GoogleUtilities - GoogleUtilities
- GTMSessionFetcher
- HLSCachingReverseProxyServer
- IosAwnCore - IosAwnCore
- nanopb - nanopb
- PINCache
- PINOperation
- PromisesObjC - PromisesObjC
- RecaptchaInterop - SDWebImage
- SwiftyGif
- TOCropViewController - TOCropViewController
EXTERNAL SOURCES: EXTERNAL SOURCES:
assets_audio_player: audio_session:
:path: ".symlinks/plugins/assets_audio_player/ios" :path: ".symlinks/plugins/audio_session/ios"
assets_audio_player_web:
:path: ".symlinks/plugins/assets_audio_player_web/ios"
awesome_notifications: awesome_notifications:
:path: ".symlinks/plugins/awesome_notifications/ios" :path: ".symlinks/plugins/awesome_notifications/ios"
awesome_notifications_core: file_picker:
:path: ".symlinks/plugins/awesome_notifications_core/ios" :path: ".symlinks/plugins/file_picker/ios"
better_player:
:path: ".symlinks/plugins/better_player/ios"
firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core: firebase_core:
:path: ".symlinks/plugins/firebase_core/ios" :path: ".symlinks/plugins/firebase_core/ios"
firebase_messaging: firebase_messaging:
:path: ".symlinks/plugins/firebase_messaging/ios" :path: ".symlinks/plugins/firebase_messaging/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_secure_storage: flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios" :path: ".symlinks/plugins/flutter_secure_storage/ios"
flutter_vibrate: flutter_vibrate:
@ -227,68 +212,65 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple: permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios" :path: ".symlinks/plugins/permission_handler_apple/ios"
record: record_darwin:
:path: ".symlinks/plugins/record/ios" :path: ".symlinks/plugins/record_darwin/ios"
rive_common: rive_common:
:path: ".symlinks/plugins/rive_common/ios" :path: ".symlinks/plugins/rive_common/ios"
sqflite: sqflite:
:path: ".symlinks/plugins/sqflite/darwin" :path: ".symlinks/plugins/sqflite/darwin"
url_launcher_ios: video_player_avfoundation:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/video_player_avfoundation/darwin"
wakelock: wakelock_plus:
:path: ".symlinks/plugins/wakelock/ios" :path: ".symlinks/plugins/wakelock_plus/ios"
webview_flutter_wkwebview: webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios" :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
assets_audio_player: edee322b9cb625571b830b35872ead1a295fd917 audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207
assets_audio_player_web: 19826380c44375761aa0b9053665c1e3fbc3b86b
awesome_notifications: db394d2e061e4583ba0f738ddea611e3986cc3fb awesome_notifications: db394d2e061e4583ba0f738ddea611e3986cc3fb
awesome_notifications_core: d02eed89738fa362d56cbd372850e9adcd2c6bef DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
better_player: 2406bfe8175203c7a46fa15f9d778d73b12e1646 DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
Cache: 4ca7e00363fca5455f26534e5607634c820ffc2d file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Firebase: 0312a2352584f782ea56f66d91606891d4607f06 Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d
firebase_auth: 193301a23be35329120526c6a83672ea40676472 firebase_core: 57aeb91680e5d5e6df6b888064be7c785f146efb
firebase_core: 22e117a2e0dec3cb318c8f53f2dd01c140375617 firebase_messaging: c862b3d2b973ecc769194dc8de09bd22c77ae757
firebase_messaging: 8999827b6efc9c3ab4b1f9dc246deaa7f13dbf88 FirebaseCore: 30e9c1cbe3d38f5f5e75f48bfcea87d7c358ec16
FirebaseAppCheckInterop: 5da5ce93e8797a215e3f677fb0654b74e736c8b8 FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 FirebaseMessaging: 7b5d8033e183ab59eb5b852a53201559e976d366
FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7
FirebaseInstallations: 91950fe859846fff0fbd296180909dd273103b09
FirebaseMessaging: 88950ba9485052891ebe26f6c43a52bb62248952
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801 flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd
HLSCachingReverseProxyServer: 59935e1e0244ad7f3375d75b5ef46e8eb26ab181
home_widget: 0434835a4c9a75704264feff6be17ea40e0f0d57 home_widget: 0434835a4c9a75704264feff6be17ea40e0f0d57
image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98 image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
IosAwnCore: ed1b2b6d84962a758354dbacd9ce525c72ce28a9 IosAwnCore: ed1b2b6d84962a758354dbacd9ce525c72ce28a9
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
nanopb: 438bc412db1928dac798aa6fd75726007be04262 nanopb: 438bc412db1928dac798aa6fd75726007be04262
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PINCache: d9a87a0ff397acffe9e2f0db972ac14680441158
PINOperation: fb563bcc9c32c26d6c78aaff967d405aa2ee74a7
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
record: cae05d8dd3cdb1dea3511b20e5a5811a1ae00d0d
rive_common: c537b4eed761e903a9403d93c347b69bd7a4762f rive_common: c537b4eed761e903a9403d93c347b69bd7a4762f
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
PODFILE CHECKSUM: d9825a12b7b9489d4776b9c9434f6b977b656841 PODFILE CHECKSUM: 76346ded4b0438dd89826a25813fc91ef681eb1f
COCOAPODS: 1.15.2 COCOAPODS: 1.15.2

View File

@ -220,6 +220,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1530; LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1510; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
@ -478,7 +479,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -503,7 +504,7 @@
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Didvan; INFOPLIST_KEY_CFBundleDisplayName = Didvan;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -565,7 +566,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -615,10 +616,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
@ -641,7 +643,7 @@
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Didvan; INFOPLIST_KEY_CFBundleDisplayName = Didvan;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -673,7 +675,7 @@
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Didvan; INFOPLIST_KEY_CFBundleDisplayName = Didvan;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news";
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true /> <true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
@ -23,17 +23,17 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<false /> <false/>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true /> <true/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>We need to access to the user gallery to add user profile photo</string> <string>We need to access to the user gallery to add user profile photo</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>We need to access to the microphone to record audio file</string> <string>Some message to describe why you need this permission</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>We need to access to the user gallery to add user profile photo</string> <string>We need to access to the user gallery to add user profile photo</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true /> <true/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>audio</string> <string>audio</string>
@ -51,12 +51,19 @@
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false /> <false/>
<key>UNNotificationServiceExtension</key> <key>UNNotificationServiceExtension</key>
<array> <array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER).MyNotificationServiceExtension</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER).MyNotificationServiceExtension</string>
</array> </array>
<key>NSAppleMusicUsageDescription</key>
<string>This app requires access to Apple Music to [explain specific reason].</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>Some message to describe why you need this permission</string> <string>... explain why the app uses the microphone here ...</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict> </dict>
</dict>
</plist> </plist>

View File

@ -35,7 +35,13 @@ class AiApiService {
request.fields['edit'] = edite.toString().toLowerCase(); request.fields['edit'] = edite.toString().toLowerCase();
} }
if (file != null) { if (file != null) {
final length = await file.length(); int length = 0;
try {
length = await file.length();
// ...
} catch (e) {
// Handle the error or return an error response
}
String basename = p.basename(file.path); String basename = p.basename(file.path);
String? mimeType = String? mimeType =
lookupMimeType(file.path); // Use MIME type instead of file extension lookupMimeType(file.path); // Use MIME type instead of file extension

View File

@ -1,10 +1,16 @@
import 'package:didvan/constants/assets.dart';
import 'package:didvan/main.dart';
import 'package:didvan/models/requests/studio.dart'; import 'package:didvan/models/requests/studio.dart';
import 'package:didvan/models/studio_details_data.dart'; import 'package:didvan/models/studio_details_data.dart';
import 'package:didvan/models/view/action_sheet_data.dart';
import 'package:didvan/providers/media.dart'; import 'package:didvan/providers/media.dart';
import 'package:didvan/services/network/request.dart'; import 'package:didvan/services/network/request.dart';
import 'package:didvan/services/network/request_helper.dart'; import 'package:didvan/services/network/request_helper.dart';
import 'package:didvan/services/storage/storage.dart'; import 'package:didvan/services/storage/storage.dart';
import 'package:didvan/utils/action_sheet.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:just_audio/just_audio.dart'; import 'package:just_audio/just_audio.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
@ -96,24 +102,58 @@ class MediaService {
} }
static Future<XFile?> pickImage({required ImageSource source}) async { static Future<XFile?> pickImage({required ImageSource source}) async {
try {
final imagePicker = ImagePicker(); final imagePicker = ImagePicker();
final XFile? pickedFile = await imagePicker.pickImage(source: source); final XFile? pickedFile = await imagePicker.pickImage(source: source);
return pickedFile; return pickedFile;
} catch (e) {
e.printError(info: 'Pick Image Fail');
return null;
}
} }
static Future<FilePickerResult?> pickPdfFile() async { static Future<FilePickerResult?> pickPdfFile() async {
try {
final FilePickerResult? result = await FilePicker.platform.pickFiles( final FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.custom, type: FileType.custom,
allowedExtensions: ['pdf'], allowedExtensions: ['pdf'],
allowMultiple: false, allowMultiple: false,
onFileLoading: onLoadingPickFile,
); );
return result; return result;
} catch (e) {
e.printError(info: 'Pick PDF Fail');
return null;
}
} }
static Future<FilePickerResult?> pickAudioFile() async { static Future<FilePickerResult?> pickAudioFile() async {
try {
return await FilePicker.platform.pickFiles( return await FilePicker.platform.pickFiles(
type: FileType.audio, type: FileType.audio,
allowMultiple: false, allowMultiple: false,
onFileLoading: onLoadingPickFile,
); );
} catch (e) {
e.printError(info: 'Pick Audio Fail');
return null;
}
}
static onLoadingPickFile(FilePickerStatus filePickerStatus) {
ActionSheetUtils.context = navigatorKey.currentContext!;
ActionSheetUtils.openDialog(
barrierDismissible: false,
data: ActionSheetData(
content: Center(
child: Image.asset(
Assets.loadingAnimation,
width: 60,
height: 60,
),
),
hasConfirmButton: false,
hasDismissButton: false,
));
} }
} }

View File

@ -182,9 +182,12 @@ class ActionSheetUtils {
); );
} }
static Future<void> openDialog({required ActionSheetData data}) async { static Future<void> openDialog(
{required ActionSheetData data,
final bool barrierDismissible = true}) async {
await showDialog( await showDialog(
context: context, context: context,
barrierDismissible: barrierDismissible,
builder: (context) => BackdropFilter( builder: (context) => BackdropFilter(
filter: ImageFilter.blur( filter: ImageFilter.blur(
sigmaX: data.isBackgroundDropBlur ? 10 : 0, sigmaX: data.isBackgroundDropBlur ? 10 : 0,

View File

@ -9,6 +9,7 @@ import 'package:didvan/models/ai/chats_model.dart';
import 'package:didvan/models/ai/files_model.dart'; import 'package:didvan/models/ai/files_model.dart';
import 'package:didvan/models/ai/messages_model.dart'; import 'package:didvan/models/ai/messages_model.dart';
import 'package:didvan/services/media/media.dart'; import 'package:didvan/services/media/media.dart';
import 'package:didvan/utils/action_sheet.dart';
import 'package:didvan/utils/date_time.dart'; import 'package:didvan/utils/date_time.dart';
import 'package:didvan/views/ai/ai_chat_state.dart'; import 'package:didvan/views/ai/ai_chat_state.dart';
import 'package:didvan/views/ai/history_ai_chat_state.dart'; import 'package:didvan/views/ai/history_ai_chat_state.dart';
@ -159,6 +160,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
if (result != null) { if (result != null) {
state.file = state.file =
FilesModel(result.files.single.path!); FilesModel(result.files.single.path!);
openAttach = false;
// Do something with the selected PDF file // Do something with the selected PDF file
} }
}, },
@ -170,6 +172,9 @@ class _AiMessageBarState extends State<AiMessageBar> {
icon: CupertinoIcons.photo, icon: CupertinoIcons.photo,
color: Colors.deepOrangeAccent, color: Colors.deepOrangeAccent,
click: () async { click: () async {
MediaService.onLoadingPickFile(
FilePickerStatus.done);
final pickedFile = final pickedFile =
await MediaService.pickImage( await MediaService.pickImage(
source: ImageSource.gallery); source: ImageSource.gallery);
@ -187,12 +192,23 @@ class _AiMessageBarState extends State<AiMessageBar> {
), ),
compressQuality: 30, compressQuality: 30,
); );
if (file == null) return;
if (file == null) {
ActionSheetUtils.pop();
return;
}
}
if (pickedFile == null) {
ActionSheetUtils.pop();
return;
} }
if (pickedFile == null) return;
state.file = kIsWeb state.file = kIsWeb
? FilesModel(pickedFile.path) ? FilesModel(pickedFile.path)
: FilesModel(file!.path); : FilesModel(file!.path);
openAttach = false;
ActionSheetUtils.pop();
}, },
), ),
if (historyState.bot!.attachmentType! if (historyState.bot!.attachmentType!
@ -207,6 +223,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
if (result != null) { if (result != null) {
state.file = state.file =
FilesModel(result.files.single.path!); FilesModel(result.files.single.path!);
openAttach = false;
} }
}, },
) )
@ -259,6 +276,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
final path = final path =
await record await record
.stop(); .stop();
state.file = FilesModel( state.file = FilesModel(
path.toString(), path.toString(),
isRecorded: true); isRecorded: true);
@ -285,12 +303,12 @@ class _AiMessageBarState extends State<AiMessageBar> {
.hasPermission()) { .hasPermission()) {
Directory? Directory?
downloadDir = downloadDir =
await getDownloadsDirectory(); await getApplicationDocumentsDirectory();
record.start( record.start(
const RecordConfig(), const RecordConfig(),
path: path:
'${downloadDir!.path}/${DateTime.now().millisecondsSinceEpoch ~/ 1000}.m4a'); '${downloadDir.path}/${DateTime.now().millisecondsSinceEpoch ~/ 1000}.m4a');
startTimer(); startTimer();
} }
}, },
@ -638,10 +656,8 @@ class _AiMessageBarState extends State<AiMessageBar> {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
await click?.call(); await click?.call();
state.update(); state.update();
setState(() {
openAttach = false;
});
}, },
child: Column( child: Column(
children: [ children: [

View File

@ -12,6 +12,7 @@ import 'package:didvan/views/widgets/didvan/text.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:get/get.dart';
import 'package:just_audio/just_audio.dart'; import 'package:just_audio/just_audio.dart';
class AudioWave extends StatefulWidget { class AudioWave extends StatefulWidget {
@ -63,6 +64,7 @@ class _AudioWaveState extends State<AudioWave> {
if (widget.file.startsWith('/uploads')) { if (widget.file.startsWith('/uploads')) {
final audioSource = LockCachingAudioSource(Uri.parse( final audioSource = LockCachingAudioSource(Uri.parse(
'${RequestHelper.baseUrl + path}?accessToken=${RequestService.token}')); '${RequestHelper.baseUrl + path}?accessToken=${RequestService.token}'));
await audioSource.request();
totalDuration = totalDuration =
await audioPlayer.setAudioSource(audioSource) ?? Duration.zero; await audioPlayer.setAudioSource(audioSource) ?? Duration.zero;
} else { } else {
@ -86,15 +88,24 @@ class _AudioWaveState extends State<AudioWave> {
Future<void> listeners() async { Future<void> listeners() async {
audioPlayer.positionStream.listen((position) async { audioPlayer.positionStream.listen((position) async {
if (randomsDisable.value.isEmpty) return;
try {
for (var i = 0; i < itemCount; i++) { for (var i = 0; i < itemCount; i++) {
if (i < if (i < randomsDisable.value.length &&
((position.inMilliseconds * 40) / totalDuration.inMilliseconds)) { i <
((position.inMilliseconds * 40) /
totalDuration.inMilliseconds)) {
final ran = randomsDisable.value[i]; final ran = randomsDisable.value[i];
randoms.value[i] = ran; randoms.value[i] = ran;
} else { } else {
randoms.value[i] = 0; randoms.value[i] = 0;
} }
} }
} catch (e) {
e.printError(info: 'listener Error');
}
if (position.inMilliseconds >= totalDuration.inMilliseconds) { if (position.inMilliseconds >= totalDuration.inMilliseconds) {
audioPlayer.stop(); audioPlayer.stop();
audioPlayer.seek(Duration.zero); audioPlayer.seek(Duration.zero);