mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Cw 430 find a better way to decide when to show the desktop UI (#977)
* Find a better way to decide when to show the desktop UI * fix UI issue for tablet view * fix trocar invoice issue for landscape layout * fix present receive option piker UI issue * fix dascktop layout * - Fix AnonPay Navigation - Fix Wallet changing on Mobile --------- Co-authored-by: Serhii <borodenko.sv@gmail.com> Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Serhii
OmarHatem
parent
d4969633b0
commit
ff420c7c7e
@@ -1,22 +1,32 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ResponsiveLayoutUtil {
|
||||
static const double _kMobileThreshold = 768;
|
||||
static const double _kMobileThreshold = 550;
|
||||
static const double kDesktopMaxWidthConstraint = 400;
|
||||
static const double kDesktopMaxDashBoardWidthConstraint = 900;
|
||||
static const double kPopupWidth = 400;
|
||||
static const double kPopupSpaceHeight = 100;
|
||||
static const _kIpadMaxWidth = 2560.0;
|
||||
|
||||
const ResponsiveLayoutUtil._();
|
||||
|
||||
static final instance = ResponsiveLayoutUtil._();
|
||||
|
||||
bool get isMobile =>
|
||||
MediaQueryData.fromWindow(WidgetsBinding.instance.window).size.width < _kMobileThreshold;
|
||||
MediaQueryData.fromWindow(WidgetsBinding.instance.window).size.shortestSide <=
|
||||
_kMobileThreshold;
|
||||
|
||||
bool get isIpad {
|
||||
final width = MediaQueryData.fromWindow(WidgetsBinding.instance.window).size.width;
|
||||
return width >= _kMobileThreshold && !(width > _kIpadMaxWidth);
|
||||
bool shouldRenderMobileUI() {
|
||||
final mediaQuery = MediaQueryData.fromWindow(WidgetsBinding.instance.window);
|
||||
final orientation = mediaQuery.orientation;
|
||||
final width = mediaQuery.size.width;
|
||||
final height = mediaQuery.size.height;
|
||||
if (isMobile ||
|
||||
(orientation == Orientation.portrait && width < height) ||
|
||||
(orientation == Orientation.landscape && width < height)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns dynamic size.
|
||||
|
||||
Reference in New Issue
Block a user