Sync all use PlatformInfo to check platform while runtime
(cherry picked from commit 514fec1f2f4f1ff8a584bf8db7bf3a5537a3e9f8)
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||
@@ -41,7 +42,7 @@ class HiveCacheConfig {
|
||||
if (databasePath != null) {
|
||||
Hive.init(databasePath);
|
||||
} else {
|
||||
if (!GetPlatform.isWeb) {
|
||||
if (PlatformInfo.isMobile) {
|
||||
Directory directory = await path_provider.getApplicationDocumentsDirectory();
|
||||
Hive.init(directory.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user