TF-3410 Use TextTheme apply almost text style for text widget
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class ThemeUtils {
|
||||
ThemeUtils._();
|
||||
|
||||
static ThemeData get appTheme {
|
||||
return ThemeData(
|
||||
@@ -23,11 +24,119 @@ class ThemeUtils {
|
||||
|
||||
static TextTheme get _textTheme {
|
||||
return const TextTheme(
|
||||
bodyMedium: TextStyle(color: AppColor.baseTextColor),
|
||||
bodySmall: TextStyle(color: AppColor.baseTextColor),
|
||||
bodyLarge: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: -0.15,
|
||||
fontSize: 17,
|
||||
height: 24 / 17,
|
||||
),
|
||||
bodyMedium: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: 0.25,
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w400,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 13,
|
||||
height: 16 / 13
|
||||
),
|
||||
labelLarge: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: 0.1,
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
displayLarge: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
displayMedium: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.4,
|
||||
),
|
||||
displaySmall: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.4,
|
||||
),
|
||||
headlineMedium: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
headlineSmall: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.4,
|
||||
),
|
||||
headlineLarge: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 32,
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 22,
|
||||
height: 28 / 22,
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: 0.15,
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: FontWeight.w500,
|
||||
letterSpacing: 0.1,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle textStyleBodyBody1({Color? color, FontWeight? fontWeight}) => TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: fontWeight ?? FontWeight.w500,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 16,
|
||||
height: 20 / 16,
|
||||
color: color,
|
||||
);
|
||||
|
||||
static TextStyle textStyleBodyBody2({Color? color, FontWeight? fontWeight}) => TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: fontWeight ?? FontWeight.w400,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 15,
|
||||
height: 20 / 15,
|
||||
color: color,
|
||||
);
|
||||
|
||||
static TextStyle textStyleBodyBody3({Color? color, FontWeight? fontWeight}) => TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: fontWeight ?? FontWeight.w400,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 14,
|
||||
height: 18 / 14,
|
||||
color: color,
|
||||
);
|
||||
|
||||
static TextStyle textStyleHeadingH6({Color? color, FontWeight? fontWeight}) => TextStyle(
|
||||
fontFamily: ConstantsUI.fontApp,
|
||||
fontWeight: fontWeight ?? FontWeight.w700,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 20,
|
||||
height: 24 / 20,
|
||||
color: color,
|
||||
);
|
||||
|
||||
static TextSelectionThemeData get _textSelectionTheme {
|
||||
return const TextSelectionThemeData(
|
||||
cursorColor: AppColor.primaryColor,
|
||||
|
||||
Reference in New Issue
Block a user