Sync all use PlatformInfo to check platform while runtime

(cherry picked from commit 514fec1f2f4f1ff8a584bf8db7bf3a5537a3e9f8)
This commit is contained in:
dab246
2023-06-15 14:26:04 +07:00
committed by Dat H. Pham
parent 3d019d644a
commit 96145aae7a
88 changed files with 298 additions and 309 deletions
@@ -9,7 +9,6 @@ import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings
import 'package:tmail_ui_user/features/manage_account/presentation/menu/widgets/setting_first_level_tile_builder.dart';
import 'package:tmail_ui_user/features/manage_account/presentation/model/account_menu_item.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import 'package:tmail_ui_user/main/utils/app_utils.dart';
class SettingsFirstLevelView extends GetWidget<SettingsController> {
SettingsFirstLevelView({Key? key}) : super(key: key);
@@ -21,16 +20,11 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(children: [
Obx(() => Padding(
Obx(() => UserInformationWidgetBuilder(
_imagePaths,
controller.manageAccountDashboardController.userProfile.value,
padding: SettingsUtils.getPaddingInFirstLevel(context, _responsiveUtils),
child: UserInformationWidgetBuilder(
_imagePaths,
controller.manageAccountDashboardController.userProfile.value,
titlePadding: EdgeInsets.only(
left: AppUtils.isDirectionRTL(context) ? 0 : 16,
right: AppUtils.isDirectionRTL(context) ? 16 : 0
))
)),
titlePadding: const EdgeInsetsDirectional.only(start: 16))),
Divider(
color: AppColor.colorDividerComposer,
height: 1,
@@ -3,7 +3,7 @@ import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/presentation/utils/style_utils.dart';
import 'package:core/presentation/views/button/icon_button_web.dart';
import 'package:core/utils/build_utils.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -50,8 +50,8 @@ class SettingsView extends GetWidget<SettingsController> {
if (controller.manageAccountDashboardController.vacationResponse.value?.vacationResponderIsValid == true) {
return VacationNotificationMessageWidget(
margin: const EdgeInsets.only(
left: BuildUtils.isWeb ? 24 : 16,
right: BuildUtils.isWeb ? 24 : 16,
left: PlatformInfo.isWeb ? 24 : 16,
right: PlatformInfo.isWeb ? 24 : 16,
top: 16),
fromAccountDashBoard: true,
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
@@ -64,8 +64,8 @@ class SettingsView extends GetWidget<SettingsController> {
&& controller.manageAccountDashboardController.inVacationSettings()) {
return VacationNotificationMessageWidget(
margin: const EdgeInsets.only(
left: BuildUtils.isWeb ? 24 : 16,
right: BuildUtils.isWeb ? 24 : 16,
left: PlatformInfo.isWeb ? 24 : 16,
right: PlatformInfo.isWeb ? 24 : 16,
top: 16),
fromAccountDashBoard: true,
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
@@ -1,6 +1,6 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/utils/build_utils.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/material.dart';
import 'package:tmail_ui_user/main/utils/app_utils.dart';
@@ -32,7 +32,7 @@ class SettingsUtils {
}
static EdgeInsets getMarginViewForSettingDetails(BuildContext context, ResponsiveUtils responsiveUtils) {
if (BuildUtils.isWeb) {
if (PlatformInfo.isWeb) {
if (responsiveUtils.isDesktop(context)) {
return const EdgeInsets.all(16);
} else if (responsiveUtils.isTabletLarge(context) ||