mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-29 21:55:58 +00:00
linux small screen width check
This commit is contained in:
parent
76e0616ade
commit
8960bb5764
2 changed files with 19 additions and 3 deletions
|
@ -76,11 +76,17 @@ void main() async {
|
|||
Util.libraryPath = await getLibraryDirectory();
|
||||
}
|
||||
|
||||
Screen? screen;
|
||||
if (Platform.isLinux || Util.isDesktop) {
|
||||
screen = await getCurrentScreen();
|
||||
Util.screenWidth = screen?.frame.width;
|
||||
}
|
||||
|
||||
if (Util.isDesktop) {
|
||||
setWindowTitle('Stack Wallet');
|
||||
setWindowMinSize(const Size(1220, 100));
|
||||
setWindowMaxSize(Size.infinite);
|
||||
final screen = await getCurrentScreen();
|
||||
|
||||
final screenHeight = screen?.frame.height;
|
||||
if (screenHeight != null) {
|
||||
// starting to height be 3/4 screen height or 900, whichever is smaller
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
abstract class Util {
|
||||
static Directory? libraryPath;
|
||||
static double? screenWidth;
|
||||
|
||||
static bool get isDesktop {
|
||||
if(Platform.isIOS && libraryPath != null && !libraryPath!.path.contains("/var/mobile/")){
|
||||
// special check for running on linux based phones
|
||||
if (Platform.isLinux && screenWidth != null && screenWidth! < 800) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// special check for running under ipad mode in macos
|
||||
if (Platform.isIOS &&
|
||||
libraryPath != null &&
|
||||
!libraryPath!.path.contains("/var/mobile/")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return Platform.isLinux || Platform.isMacOS || Platform.isWindows;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue