From 05440e8bc4374978b1ad03026a9b7c1c971c0692 Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 10 Feb 2022 12:20:46 +0700 Subject: [PATCH] TF-248 Ignore all plugin not supported web --- lib/features/caching/config/hive_cache_config.dart | 8 +++++--- lib/features/home/presentation/home_controller.dart | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/features/caching/config/hive_cache_config.dart b/lib/features/caching/config/hive_cache_config.dart index dee33e3da..35ec7560d 100644 --- a/lib/features/caching/config/hive_cache_config.dart +++ b/lib/features/caching/config/hive_cache_config.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:path_provider/path_provider.dart' as pathProvider; import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_cache.dart'; @@ -20,9 +21,10 @@ class HiveCacheConfig { if (databasePath != null) { Hive.init(databasePath); } else { - Directory directory = await pathProvider - .getApplicationDocumentsDirectory(); - Hive.init(directory.path); + if (!GetPlatform.isWeb) { + Directory directory = await pathProvider.getApplicationDocumentsDirectory(); + Hive.init(directory.path); + } } } diff --git a/lib/features/home/presentation/home_controller.dart b/lib/features/home/presentation/home_controller.dart index a17314a11..2b6a0dff7 100644 --- a/lib/features/home/presentation/home_controller.dart +++ b/lib/features/home/presentation/home_controller.dart @@ -25,7 +25,9 @@ class HomeController extends GetxController { @override void onReady() { super.onReady(); - _initFlutterDownloader(); + if (!GetPlatform.isWeb) { + _initFlutterDownloader(); + } _cleanupEmailCache(); }