TF-398 Fix responsive on browser firefox

This commit is contained in:
dab246
2022-03-24 16:02:52 +07:00
committed by Dat H. Pham
parent 72df7d65c6
commit d4ead8d68e
@@ -1,3 +1,5 @@
import 'package:core/utils/app_logger.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
@@ -25,10 +27,9 @@ class ResponsiveUtils {
double getSizeScreenShortestSide(BuildContext context) => context.mediaQueryShortestSide;
double getDeviceWidth(BuildContext context) {
if (GetPlatform.isDesktop) {
return context.width;
}
return context.mediaQueryShortestSide;
final widthScreen = kIsWeb ? context.width : context.mediaQueryShortestSide;
log('ResponsiveUtils::getDeviceWidth(): widthScreen: $widthScreen');
return widthScreen;
}
bool isMobile(BuildContext context) => getDeviceWidth(context) < minTabletWidth;