"Added url_launcher_ios pod, modified Firebase API to remove permission request, updated AI chat page and message bar widgets with platform-specific conditions for audio handling and recording."

This commit is contained in:
Amir Hossein Mousavi 2024-09-17 10:50:07 +03:30
parent bfabecef45
commit dcb7e6b0da
4 changed files with 18 additions and 7 deletions

View File

@ -140,6 +140,8 @@ PODS:
- FlutterMacOS
- SwiftyGif (5.4.5)
- TOCropViewController (2.6.1)
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS
@ -167,6 +169,7 @@ DEPENDENCIES:
- record_darwin (from `.symlinks/plugins/record_darwin/ios`)
- rive_common (from `.symlinks/plugins/rive_common/ios`)
- 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_plus (from `.symlinks/plugins/wakelock_plus/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
@ -226,6 +229,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/rive_common/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
wakelock_plus:
@ -267,6 +272,7 @@ SPEC CHECKSUMS:
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36

View File

@ -9,8 +9,6 @@ class FirebaseApi {
static String? fcmToken;
Future<void> initNotification() async {
await _firebaseMessaging.requestPermission();
try {
fcmToken = await _firebaseMessaging.getToken();
if (kDebugMode) {

View File

@ -1,5 +1,7 @@
// ignore_for_file: library_private_types_in_public_api, deprecated_member_use, depend_on_referenced_packages
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:didvan/config/design_config.dart';
import 'package:didvan/config/theme_data.dart';
@ -423,7 +425,7 @@ class _AiChatPageState extends State<AiChatPage> {
children: [
if (message.role.toString().contains('user') &&
file != null)
file.isAudio()
(file.isAudio() && (!kIsWeb && !Platform.isIOS))
? Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 8),

View File

@ -244,7 +244,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
);
},
),
if (!kIsWeb || !Platform.isIOS)
if (!kIsWeb && !Platform.isIOS)
if (historyState.bot!.attachmentType!
.contains('audio'))
attachBtn(
@ -331,7 +331,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
click: () async {
path = await record
.stop();
state.file = FilesModel(
path.toString(),
isRecorded: true,
@ -342,7 +342,9 @@ class _AiMessageBarState extends State<AiMessageBar> {
state.update();
},
)
: (!kIsWeb || !Platform.isIOS) &&
: (!kIsWeb &&
!Platform
.isIOS) &&
widget.bot
.attachmentType!
.contains(
@ -382,7 +384,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
} catch (e) {
if (kDebugMode) {
print(
'Error starting recording: $e');
'Error starting recording: $e');
}
}
}
@ -441,6 +443,9 @@ class _AiMessageBarState extends State<AiMessageBar> {
fileName: state
.file
?.basename,
fileLocal:
state
.file,
finished:
true,
role: 'user',