diff --git a/lib/main.dart b/lib/main.dart index ad1ef9b7f..e1297cc5a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -68,6 +68,9 @@ final openedFromSWBFileStringStateProvider = void main() async { WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); GoogleFonts.config.allowRuntimeFetching = false; + if(Platform.isIOS){ + Util.libraryPath = await getLibraryDirectory(); + } if (Util.isDesktop) { setWindowTitle('Stack Wallet'); diff --git a/lib/utilities/util.dart b/lib/utilities/util.dart index 8a98787f2..5963bfee9 100644 --- a/lib/utilities/util.dart +++ b/lib/utilities/util.dart @@ -1,9 +1,14 @@ import 'dart:io'; import 'package:flutter/material.dart'; +import 'package:path_provider/path_provider.dart'; abstract class Util { + static Directory? libraryPath; static bool get isDesktop { + if(Platform.isIOS && libraryPath != null && !libraryPath!.path.contains("/var/mobile/")){ + return true; + } return Platform.isLinux || Platform.isMacOS || Platform.isWindows; }