TF-788 Correct the padding for All Settings screens

This commit is contained in:
Dat PHAM HOANG
2022-08-24 21:49:54 +07:00
committed by Dat H. Pham
parent 2532959483
commit 199cb2529c
8 changed files with 42 additions and 77 deletions
@@ -1,12 +1,13 @@
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/utils/build_utils.dart';
import 'package:flutter/widgets.dart';
class SettingsUtils {
static double getHorizontalPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
if (responsiveUtils.isMobile(context)) {
return 17;
return 16;
} else {
return 33;
return 32;
}
}
@@ -17,4 +18,27 @@ class SettingsUtils {
return const EdgeInsets.only(left: 32, top: 12, bottom: 12, right: 32);
}
}
static EdgeInsets getMarginViewForSettingDetails(BuildContext context, ResponsiveUtils responsiveUtils) {
if (BuildUtils.isWeb) {
if (responsiveUtils.isDesktop(context)) {
return const EdgeInsets.only(left: 16, top: 16, right: 24, bottom: 24);
} else if (responsiveUtils.isTabletLarge(context) ||
responsiveUtils.isTablet(context)) {
return const EdgeInsets.only(right: 32, top: 16, bottom: 16, left: 32);
} else {
return const EdgeInsets.only(right: 16, top: 16, bottom: 16, left: 16);
}
} else {
if (responsiveUtils.isLandscapeTablet(context) ||
responsiveUtils.isTabletLarge(context) ||
responsiveUtils.isTablet(context)) {
return const EdgeInsets.only(right: 32, top: 16, bottom: 16, left: 32);
} else if (responsiveUtils.isDesktop(context)) {
return const EdgeInsets.only(right: 32, top: 16, bottom: 16);
} else {
return const EdgeInsets.only(right: 16, top: 16, bottom: 16, left: 16);
}
}
}
}