chore: add textTheme to AppTheme (#1448)

* chore: add textTheme to AppTheme

* chore: extend scaled font size options

* chore: add text styles to extension and rename extension to AFThemeExtension

* chore: use 2021 material design text style tokens
This commit is contained in:
Richard Shiue
2022-11-17 15:28:57 +08:00
committed by GitHub
parent eb35fb25af
commit f00a78746e
16 changed files with 138 additions and 40 deletions

View File

@ -189,7 +189,7 @@ class _Background extends StatelessWidget {
return FlowyHoverContainer(
style: HoverStyle(
borderRadius: Corners.s6Border,
hoverColor: CustomColors.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
),
);
} else {
@ -210,7 +210,8 @@ class CellAccessoryContainer extends StatelessWidget {
final children =
accessories.where((accessory) => accessory.enable()).map((accessory) {
final hover = FlowyHover(
style: HoverStyle(hoverColor: CustomColors.of(context).lightGreyHover),
style:
HoverStyle(hoverColor: AFThemeExtension.of(context).lightGreyHover),
builder: (_, onHover) => Container(
width: 26,
height: 26,

View File

@ -201,7 +201,7 @@ class _CellCalendarWidgetState extends State<_CellCalendarWidget> {
borderRadius: const BorderRadius.all(Radius.circular(6)),
),
todayDecoration: BoxDecoration(
color: CustomColors.of(context).lightGreyHover,
color: AFThemeExtension.of(context).lightGreyHover,
shape: BoxShape.rectangle,
borderRadius: const BorderRadius.all(Radius.circular(6)),
),

View File

@ -10,23 +10,23 @@ extension SelectOptionColorExtension on SelectOptionColorPB {
Color make(BuildContext context) {
switch (this) {
case SelectOptionColorPB.Purple:
return CustomColors.tint1;
return AFThemeExtension.tint1;
case SelectOptionColorPB.Pink:
return CustomColors.tint2;
return AFThemeExtension.tint2;
case SelectOptionColorPB.LightPink:
return CustomColors.tint3;
return AFThemeExtension.tint3;
case SelectOptionColorPB.Orange:
return CustomColors.tint4;
return AFThemeExtension.tint4;
case SelectOptionColorPB.Yellow:
return CustomColors.tint5;
return AFThemeExtension.tint5;
case SelectOptionColorPB.Lime:
return CustomColors.tint6;
return AFThemeExtension.tint6;
case SelectOptionColorPB.Green:
return CustomColors.tint7;
return AFThemeExtension.tint7;
case SelectOptionColorPB.Aqua:
return CustomColors.tint8;
return AFThemeExtension.tint8;
case SelectOptionColorPB.Blue:
return CustomColors.tint9;
return AFThemeExtension.tint9;
default:
throw ArgumentError;
}

View File

@ -214,7 +214,7 @@ class _CreateOptionCell extends StatelessWidget {
const HSpace(10),
SelectOptionTag(
name: name,
color: CustomColors.of(context).lightGreyHover,
color: AFThemeExtension.of(context).lightGreyHover,
onSelected: () => context
.read<SelectOptionCellEditorBloc>()
.add(SelectOptionEditorEvent.newOption(name)),

View File

@ -15,7 +15,7 @@ class GridAddRowButton extends StatelessWidget {
Widget build(BuildContext context) {
return FlowyButton(
text: FlowyText.medium(LocaleKeys.grid_row_newRow.tr(), fontSize: 12),
hoverColor: CustomColors.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () => context.read<GridBloc>().add(const GridEvent.createRow()),
leftIcon: svgWidget(
"home/add",

View File

@ -166,7 +166,7 @@ class FieldCellButton extends StatelessWidget {
.replaceAll(Characters(''), Characters('\u{200B}'))
.toString();
return FlowyButton(
hoverColor: CustomColors.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: onTap,
leftIcon: svgWidget(
field.fieldType.iconName(),

View File

@ -182,7 +182,7 @@ class CreateFieldButton extends StatelessWidget {
LocaleKeys.grid_field_newColumn.tr(),
fontSize: 12,
),
hoverColor: CustomColors.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () {},
leftIcon: svgWidget(
"home/add",

View File

@ -202,7 +202,7 @@ class _CreateFieldButtonState extends State<_CreateFieldButton> {
LocaleKeys.grid_field_newColumn.tr(),
fontSize: 12,
),
hoverColor: CustomColors.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () {},
leftIcon: svgWidget("home/add"),
),