make m1 mac (ipad mode) work in desktop mode

This commit is contained in:
rehrar 2022-10-20 11:36:49 -06:00
parent b2cb194c61
commit 3e34f18f9c
2 changed files with 8 additions and 0 deletions

View file

@ -68,6 +68,9 @@ final openedFromSWBFileStringStateProvider =
void main() async { void main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
GoogleFonts.config.allowRuntimeFetching = false; GoogleFonts.config.allowRuntimeFetching = false;
if(Platform.isIOS){
Util.libraryPath = await getLibraryDirectory();
}
if (Util.isDesktop) { if (Util.isDesktop) {
setWindowTitle('Stack Wallet'); setWindowTitle('Stack Wallet');

View file

@ -1,9 +1,14 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
abstract class Util { abstract class Util {
static Directory? libraryPath;
static bool get isDesktop { static bool get isDesktop {
if(Platform.isIOS && libraryPath != null && !libraryPath!.path.contains("/var/mobile/")){
return true;
}
return Platform.isLinux || Platform.isMacOS || Platform.isWindows; return Platform.isLinux || Platform.isMacOS || Platform.isWindows;
} }