TF-161 Rotate the display in mobile view
This commit is contained in:
@@ -14,6 +14,8 @@ class ResponsiveUtils {
|
||||
static const double _desktopVerticalMargin = 144.0;
|
||||
static const double _desktopHorizontalMargin = 234.0;
|
||||
|
||||
bool isMobileDevice(BuildContext context) => MediaQuery.of(context).size.shortestSide < 600;
|
||||
|
||||
double getSizeWidthScreen(BuildContext context) => MediaQuery.of(context).size.width;
|
||||
|
||||
double getSizeHeightScreen(BuildContext context) => MediaQuery.of(context).size.height;
|
||||
@@ -24,6 +26,10 @@ class ResponsiveUtils {
|
||||
|
||||
bool isDesktop(BuildContext context) => getSizeWidthScreen(context) >= minDesktopWidth;
|
||||
|
||||
bool isPortrait(BuildContext context) => MediaQuery.of(context).orientation == Orientation.portrait;
|
||||
|
||||
bool isLandscape(BuildContext context) => MediaQuery.of(context).orientation == Orientation.landscape;
|
||||
|
||||
double getWidthLoginTextField(BuildContext context) => isMobile(context) ? _loginTextFieldWidthSmallScreen : _loginTextFieldWidthLargeScreen;
|
||||
|
||||
double getWidthLoginButton() => _loginButtonWidth;
|
||||
|
||||
@@ -19,7 +19,9 @@ class ResponsiveWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
if (responsiveUtils.isMobileDevice(context)) {
|
||||
return mobile;
|
||||
} else if (responsiveUtils.isDesktop(context)) {
|
||||
return desktop ?? tablet;
|
||||
} else if (responsiveUtils.isTablet(context)) {
|
||||
return tablet;
|
||||
|
||||
Reference in New Issue
Block a user