TF-3410 Use TextTheme apply almost text style for text widget
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/base/setting_detail_view_builder.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings_utils.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/setting_option_type.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/preferences/preferences_controller.dart';
|
||||
@@ -11,60 +12,63 @@ class PreferencesView extends GetWidget<PreferencesController> with AppLoaderMix
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: SettingsUtils.getBackgroundColor(context, controller.responsiveUtils),
|
||||
body: Padding(
|
||||
padding: SettingsUtils.getMarginViewForSettingDetails(context, controller.responsiveUtils),
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() {
|
||||
if (!controller.isLoading) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: horizontalLoadingWidget,
|
||||
);
|
||||
}),
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: SettingsUtils.getContentBackgroundColor(
|
||||
context, controller.responsiveUtils,
|
||||
),
|
||||
decoration: SettingsUtils.getBoxDecorationForContent(
|
||||
context,
|
||||
controller.responsiveUtils,
|
||||
),
|
||||
width: double.infinity,
|
||||
padding: SettingsUtils.getPaddingAlwaysReadReceiptSetting(
|
||||
context,
|
||||
controller.responsiveUtils,
|
||||
),
|
||||
child: Obx(() {
|
||||
final settingOption = controller.settingOption.value;
|
||||
|
||||
if (settingOption == null) return const SizedBox.shrink();
|
||||
|
||||
final settingOptionList = SettingOptionType.values.toList();
|
||||
|
||||
return ListView.separated(
|
||||
itemCount: settingOptionList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SettingOptionItem(
|
||||
imagePaths: controller.imagePaths,
|
||||
settingOption: settingOption,
|
||||
optionType: settingOptionList[index],
|
||||
onTapSettingOptionAction: controller.updateStateSettingOption,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 60),
|
||||
);
|
||||
}),
|
||||
),
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() {
|
||||
if (!controller.isLoading) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Padding(
|
||||
padding: controller.responsiveUtils.isTablet(context)
|
||||
? const EdgeInsetsDirectional.only(start: 32, end: 32, top: 16)
|
||||
: const EdgeInsetsDirectional.only(start: 16, end: 16, top: 16),
|
||||
child: horizontalLoadingWidget,
|
||||
);
|
||||
}),
|
||||
Expanded(
|
||||
child: SettingDetailViewBuilder(
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
padding: SettingsUtils.getSettingContentWithoutHeaderPadding(
|
||||
context,
|
||||
controller.responsiveUtils,
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
color: SettingsUtils.getContentBackgroundColor(
|
||||
context, controller.responsiveUtils,
|
||||
),
|
||||
decoration: SettingsUtils.getBoxDecorationForContent(
|
||||
context,
|
||||
controller.responsiveUtils,
|
||||
),
|
||||
width: double.infinity,
|
||||
padding: SettingsUtils.getPreferencesSettingPadding(
|
||||
context,
|
||||
controller.responsiveUtils,
|
||||
),
|
||||
child: Obx(() {
|
||||
final settingOption = controller.settingOption.value;
|
||||
|
||||
if (settingOption == null) return const SizedBox.shrink();
|
||||
|
||||
final settingOptionList = SettingOptionType.values.toList();
|
||||
|
||||
return ListView.separated(
|
||||
itemCount: settingOptionList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SettingOptionItem(
|
||||
imagePaths: controller.imagePaths,
|
||||
settingOption: settingOption,
|
||||
optionType: settingOptionList[index],
|
||||
onTapSettingOptionAction: controller.updateStateSettingOption,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 60),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
+4
-6
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/constants/constants_ui.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -34,6 +35,7 @@ class SettingOptionItem extends StatelessWidget {
|
||||
Text(
|
||||
optionType.getTitle(appLocalizations),
|
||||
style: const TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontSize: 15,
|
||||
height: 20 / 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -44,9 +46,7 @@ class SettingOptionItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 24),
|
||||
child: Text(
|
||||
optionType.getExplanation(appLocalizations),
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
height: 16 / 13,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
@@ -71,9 +71,7 @@ class SettingOptionItem extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
optionType.getToggleDescription(appLocalizations),
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
height: 16 / 13,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user