TF-528 Update size for responsive on tablet and landscape mobile

This commit is contained in:
dab246
2022-05-04 10:52:57 +07:00
committed by Dat H. Pham
parent 2e3c4e8f88
commit dbbc13eab4
20 changed files with 316 additions and 418 deletions
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
class ResponsiveWidget extends StatelessWidget {
final Widget mobile;
final Widget? landscapeMobile;
final Widget? tablet;
final Widget? tabletLarge;
final Widget? desktop;
@@ -13,6 +14,7 @@ class ResponsiveWidget extends StatelessWidget {
Key? key,
required this.responsiveUtils,
required this.mobile,
this.landscapeMobile,
this.tablet,
this.desktop,
this.tabletLarge,
@@ -22,6 +24,7 @@ class ResponsiveWidget extends StatelessWidget {
Widget build(BuildContext context) {
if (desktop != null && responsiveUtils.isDesktop(context)) return desktop!;
if (tabletLarge != null && responsiveUtils.isTabletLarge(context)) return tabletLarge!;
if (landscapeMobile != null && responsiveUtils.isLandscapeMobile(context)) return landscapeMobile!;
if (tablet != null && responsiveUtils.isTablet(context)) return tablet!;
return mobile;
}