diff --git a/ios/Podfile.lock b/ios/Podfile.lock index beb7c61..db378ff 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -73,6 +73,8 @@ PODS: - Flutter (1.0.0) - flutter_background_service_ios (0.0.3): - Flutter + - flutter_downloader (0.0.1): + - Flutter - flutter_local_notifications (0.0.1): - Flutter - flutter_secure_storage (6.0.0): @@ -166,6 +168,7 @@ DEPENDENCIES: - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_background_service_ios (from `.symlinks/plugins/flutter_background_service_ios/ios`) + - flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - flutter_sound (from `.symlinks/plugins/flutter_sound/ios`) @@ -219,6 +222,8 @@ EXTERNAL SOURCES: :path: Flutter flutter_background_service_ios: :path: ".symlinks/plugins/flutter_background_service_ios/ios" + flutter_downloader: + :path: ".symlinks/plugins/flutter_downloader/ios" flutter_local_notifications: :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_secure_storage: @@ -271,6 +276,7 @@ SPEC CHECKSUMS: FirebaseMessaging: 7b5d8033e183ab59eb5b852a53201559e976d366 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_background_service_ios: e30e0d3ee69e4cee66272d0c78eacd48c2e94aac + flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be flutter_sound: dde9a913063b65a27ba8fdc2039036b99b136c79 diff --git a/lib/main.dart b/lib/main.dart index 511b7b4..40038ef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,7 @@ // ignore_for_file: deprecated_member_use import 'dart:async'; +import 'dart:io'; import 'package:android_intent_plus/android_intent.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -24,6 +25,7 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:get/get.dart'; import 'package:home_widget/home_widget.dart'; import 'package:provider/provider.dart'; import 'package:flutter_downloader/flutter_downloader.dart'; @@ -67,12 +69,18 @@ void main() async { HomeWidget.registerBackgroundCallback(_backgroundCallbackHomeWidget); HomeWidget.registerInteractivityCallback(_backgroundCallbackHomeWidget); await NotificationService.initializeNotification(); - await FlutterDownloader.initialize( - debug: - true, // optional: set to false to disable printing logs to console (default: true) - ignoreSsl: - true // option: set to false to disable working with http links (default: false) - ); + try { + if (Platform.isAndroid) { + await FlutterDownloader.initialize( + debug: + true, // optional: set to false to disable printing logs to console (default: true) + ignoreSsl: + true // option: set to false to disable working with http links (default: false) + ); + } + } catch (e) { + e.printError(); + } } // FirebaseMessaging.onBackgroundMessage(_initPushNotification); diff --git a/lib/views/ai/ai_chat_page.dart b/lib/views/ai/ai_chat_page.dart index 7520292..a7907f9 100644 --- a/lib/views/ai/ai_chat_page.dart +++ b/lib/views/ai/ai_chat_page.dart @@ -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'; @@ -679,7 +681,7 @@ class _AiChatPageState extends State { ), ), ), - if (message.file != null) + if (message.file != null && !Platform.isIOS) Padding( padding: const EdgeInsets.all(8.0), child: InkWell(