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
@@ -71,11 +71,7 @@ class SettingsView extends GetWidget<SettingsController> {
return const SizedBox.shrink();
}
}),
Expanded(child: Padding(
padding: !BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context)
? const EdgeInsets.only(left: 8)
: const EdgeInsets.only(left: 24),
child: _bodySettingsScreen()))
Expanded(child: _bodySettingsScreen())
]
)
);
@@ -115,7 +111,6 @@ class SettingsView extends GetWidget<SettingsController> {
Widget _buildSettingLevel1AppBar(BuildContext context) {
return Row(children: [
_buildBackButton(context),
const SizedBox(width: 8),
Expanded(
child: Text(
AppLocalizations.of(context).settings,
@@ -129,7 +124,7 @@ class SettingsView extends GetWidget<SettingsController> {
Widget _buildBackButton(BuildContext context) {
return buildIconWeb(
icon: SvgPicture.asset(_imagePaths.icBack, width: 18, height: 18, color: AppColor.colorTextButton, fit: BoxFit.fill),
icon: SvgPicture.asset(_imagePaths.icBack, width: 9, height: 16, color: AppColor.colorTextButton, fit: BoxFit.fill),
tooltip: AppLocalizations.of(context).back,
onTap: controller.backToUniversalSettings
);
@@ -137,7 +132,7 @@ class SettingsView extends GetWidget<SettingsController> {
Widget _buildCloseSettingButton(BuildContext context) {
return buildIconWeb(
icon: SvgPicture.asset(_imagePaths.icCloseMailbox, width: 28, height: 28, fit: BoxFit.fill),
icon: SvgPicture.asset(_imagePaths.icClose, width: 28, height: 28, fit: BoxFit.fill),
tooltip: AppLocalizations.of(context).close,
onTap: closeAction);
}
@@ -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);
}
}
}
}
@@ -72,6 +72,7 @@ class SettingFirstLevelTileBuilder extends StatelessWidget {
]
)),
IconButton(
padding: EdgeInsets.only(right: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)),
icon: SvgPicture.asset(
_imagePath.icCollapseFolder,
fit: BoxFit.fill,