Use fontFamily for all style in Text widget

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-07-15 09:26:07 +07:00
committed by Dat H. Pham
parent 991ab686a4
commit a9a322818a
186 changed files with 717 additions and 443 deletions
@@ -1,6 +1,7 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/style_utils.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/datetime_extension.dart';
@@ -59,7 +60,7 @@ class BorderButtonField<T> extends StatelessWidget {
);
if (label != null) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(label!, style: const TextStyle(
Text(label!, style: ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 14,
fontWeight: FontWeight.normal,
color: AppColor.colorContentEmail)),
@@ -73,12 +74,12 @@ class BorderButtonField<T> extends StatelessWidget {
TextStyle? _getTextStyle(T? value) {
if (hintText != null && value == null) {
return const TextStyle(
return ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 16,
fontWeight: FontWeight.normal,
color: AppColor.colorHintInputCreateMailbox);
}
return textStyle ?? const TextStyle(
return textStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black);
@@ -2,6 +2,7 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/style_utils.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:core/presentation/views/floating_button/scrolling_floating_button_animated.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -37,7 +38,7 @@ class ComposeFloatingButton extends StatelessWidget {
child: Text(AppLocalizations.of(context).compose,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.w500
@@ -2,6 +2,7 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/style_utils.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -67,7 +68,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
? Row(children: [
Expanded(child: Text(
_getTextItemDropdown(context, item: itemSelected),
style: TextStyle(fontSize: 16,
style: ThemeUtils.defaultTextStyleInterFont.copyWith(fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black.withOpacity(opacity)),
maxLines: 1,
@@ -85,7 +86,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
height: heightItem,
child: Row(children: [
Expanded(child: Text(_getTextItemDropdown(context, item: item),
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black),
@@ -121,7 +122,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
child: Row(children: [
Expanded(child: Text(
_getTextItemDropdown(context, item: itemSelected),
style: TextStyle(fontSize: 16,
style: ThemeUtils.defaultTextStyleInterFont.copyWith(fontSize: 16,
fontWeight: FontWeight.normal,
color: itemSelected != null ? Colors.black.withOpacity(opacity) : AppColor.textFieldHintColor),
maxLines: 1,
@@ -1,3 +1,4 @@
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'package:tmail_ui_user/features/base/styles/hyper_link_widget_styles.dart';
@@ -14,7 +15,7 @@ class HyperLinkWidget extends StatelessWidget {
return Text.rich(
TextSpan(
text: urlString,
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
color: HyperLinkWidgetStyles.textColor,
fontSize: HyperLinkWidgetStyles.textSize,
decoration: TextDecoration.underline
@@ -1,5 +1,6 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
typedef OnTapMaterialTextButton = Function();
@@ -48,7 +49,7 @@ class MaterialTextButton extends StatelessWidget {
label,
overflow: overflow,
softWrap: softWrap,
style: customStyle ?? TextStyle(
style: customStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: labelSize,
color: labelColor ?? AppColor.colorTextButton,
fontWeight: labelWeight ?? FontWeight.normal
@@ -1,5 +1,6 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -47,7 +48,7 @@ class MaterialTextIconButton extends StatelessWidget {
),
label: Text(
label,
style: labelStyle ?? TextStyle(
style: labelStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 16,
color: labelColor ?? AppColor.colorTextButton,
fontWeight: FontWeight.w500
@@ -1,4 +1,5 @@
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';
@@ -38,7 +39,7 @@ class PopupItemNoIconWidget extends StatelessWidget {
child: Row(children: [
Expanded(child: Text(
_nameAction,
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 17,
color: Colors.black,
fontWeight: FontWeight.normal
@@ -1,5 +1,6 @@
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
@@ -31,7 +32,7 @@ class RecentItemTileWidget<T> extends StatelessWidget {
Expanded(
child: Text(
_getTitle(item),
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 15,
fontWeight: FontWeight.normal,
color: Colors.black
@@ -30,19 +30,19 @@ class TextInputDecorationBuilder extends InputDecorationBuilder {
prefixText: prefixText,
labelText: labelText,
floatingLabelBehavior: FloatingLabelBehavior.never,
labelStyle: labelStyle ?? const TextStyle(
labelStyle: labelStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
color: Colors.black,
fontSize: 16),
hintText: hintText,
isDense: true,
hintStyle: hintStyle ?? const TextStyle(
hintStyle: hintStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
color: AppColor.loginTextFieldHintColor,
fontSize: 16),
contentPadding: contentPadding ?? const EdgeInsets.symmetric(
horizontal: 12,
vertical: 12),
errorText: errorText,
errorStyle: errorTextStyle ?? const TextStyle(
errorStyle: errorTextStyle ?? ThemeUtils.defaultTextStyleInterFont.copyWith(
color: AppColor.colorInputBorderErrorVerifyName,
fontSize: 13),
filled: true,
@@ -41,7 +41,7 @@ class TextInputFieldBuilder extends StatelessWidget {
if (label != null)
...[
Text(isMandatory ? '${label!}*' : label!,
style: const TextStyle(
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
fontSize: 14,
fontWeight: FontWeight.normal,
color: AppColor.colorContentEmail)),
@@ -52,7 +52,7 @@ class TextInputFieldBuilder extends StatelessWidget {
textInputAction: TextInputAction.next,
controller: editingController,
focusNode: focusNode,
textStyle: const TextStyle(color: Colors.black, fontSize: 16),
textStyle: ThemeUtils.defaultTextStyleInterFont.copyWith(color: Colors.black, fontSize: 16),
keyboardType: inputType ?? TextInputType.text,
textDirection: DirectionUtils.getDirectionByLanguage(context),
minLines: minLines,
@@ -7,7 +7,6 @@ class UserAvatarBuilder extends StatelessWidget {
final double? size;
final TextStyle? textStyle;
final EdgeInsetsGeometry? padding;
final TextStyle? textStyle;
final VoidCallback? onTapAction;
const UserAvatarBuilder({
@@ -16,7 +15,6 @@ class UserAvatarBuilder extends StatelessWidget {
this.size,
this.textStyle,
this.padding,
this.textStyle,
this.onTapAction,
}) : super(key: key);