Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: use theme.of(context) text theme in FlowyText (#1463)

Richard Shiue81bc31d1b18d
diff --git a/frontend/app_flowy/lib/plugins/blank/blank.dart b/frontend/app_flowy/lib/plugins/blank/blank.dart
index 65c3215131..ac4a6b9187 100644
--- a/frontend/app_flowy/lib/plugins/blank/blank.dart
+++ b/frontend/app_flowy/lib/plugins/blank/blank.dart
@@ -40,8 +40,7 @@ class BlankPagePlugin extends Plugin {
class BlankPagePluginDisplay extends PluginDisplay with NavigationItem {
@override
- Widget get leftBarItem =>
- FlowyText.medium(LocaleKeys.blankPageTitle.tr(), fontSize: 12);
+ Widget get leftBarItem => FlowyText.medium(LocaleKeys.blankPageTitle.tr());
@override
Widget buildWidget(PluginContext context) => const BlankPage();
diff --git a/frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart b/frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart
index e583986edf..c074900d85 100644
--- a/frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart
+++ b/frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart
@@ -7,7 +7,6 @@ import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_propert
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
-import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@@ -105,10 +104,7 @@ class _SettingItem extends StatelessWidget {
height: 30,
child: FlowyButton(
isSelected: isSelected,
- text: FlowyText.medium(
- action.title(),
- fontSize: FontSizes.s12,
- ),
+ text: FlowyText.medium(action.title()),
onTap: () {
context
.read<BoardSettingBloc>()
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart
index 90aac52592..fd9939bacd 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart
@@ -91,7 +91,6 @@ class SelectOptionTag extends StatelessWidget {
pressElevation: 1,
label: FlowyText.medium(
name,
- fontSize: 12,
overflow: TextOverflow.clip,
),
selectedColor: color,
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart
index 06fc419460..db4f7a9403 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart
@@ -190,7 +190,6 @@ class _Title extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 6),
child: FlowyText.medium(
LocaleKeys.grid_selectOption_panelTitle.tr(),
- fontSize: 12,
color: Theme.of(context).hintColor,
),
),
@@ -208,7 +207,6 @@ class _CreateOptionCell extends StatelessWidget {
children: [
FlowyText.medium(
LocaleKeys.grid_selectOption_create.tr(),
- fontSize: 12,
color: Theme.of(context).hintColor,
),
const HSpace(10),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart
index 270cdf17af..40bc009663 100755
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart
@@ -174,7 +174,6 @@ class FieldCellButton extends StatelessWidget {
),
text: FlowyText.medium(
text,
- fontSize: 12,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart
index 4b5830588e..8fb81f5395 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart
@@ -78,7 +78,6 @@ class _EditFieldButton extends StatelessWidget {
child: FlowyButton(
text: FlowyText.medium(
LocaleKeys.grid_field_editProperty.tr(),
- fontSize: 12,
),
onTap: onTap,
),
@@ -150,7 +149,6 @@ class FieldActionCell extends StatelessWidget {
return FlowyButton(
text: FlowyText.medium(
action.title(),
- fontSize: 12,
color: enable ? null : Theme.of(context).disabledColor,
),
onTap: () {
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart
index 98c0cd87b6..22655bc42e 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart
@@ -66,7 +66,6 @@ class _FieldEditorState extends State<FieldEditor> {
children: [
FlowyText.medium(
LocaleKeys.grid_field_editProperty.tr(),
- fontSize: 12,
),
const VSpace(10),
_FieldNameTextField(popoverMutex: popoverMutex),
@@ -223,7 +222,6 @@ class _DeleteFieldButton extends StatelessWidget {
Widget button = FlowyButton(
text: FlowyText.medium(
LocaleKeys.grid_field_delete.tr(),
- fontSize: 12,
color: enable ? null : Theme.of(context).disabledColor,
),
onTap: () => onDeleted?.call(),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart
index ea4fe544a5..55d495f0ec 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart
@@ -61,7 +61,7 @@ class FieldTypeCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(fieldType.title(), fontSize: 12),
+ text: FlowyText.medium(fieldType.title()),
onTap: () => onSelectField(fieldType),
leftIcon: svgWidget(
fieldType.iconName(),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart
index a9b6d4114e..65c5e1eae1 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart
@@ -111,7 +111,6 @@ class _SwitchFieldButton extends StatelessWidget {
return FlowyButton(
text: FlowyText.medium(
bloc.state.field.fieldType.title(),
- fontSize: 12,
),
margin: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
leftIcon: svgWidget(
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart
index 76ac94ac08..72870c2373 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart
@@ -178,10 +178,7 @@ class CreateFieldButton extends StatelessWidget {
constraints: BoxConstraints.loose(const Size(240, 600)),
child: FlowyButton(
radius: BorderRadius.zero,
- text: FlowyText.medium(
- LocaleKeys.grid_field_newColumn.tr(),
- fontSize: 12,
- ),
+ text: FlowyText.medium(LocaleKeys.grid_field_newColumn.tr()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () {},
leftIcon: svgWidget(
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart
index c5926bf1e2..126301a237 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart
@@ -122,8 +122,7 @@ class DateFormatButton extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.grid_field_dateFormat.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.grid_field_dateFormat.tr()),
margin: GridSize.typeOptionContentInsets,
onTap: onTap,
onHover: onHover,
@@ -149,8 +148,7 @@ class TimeFormatButton extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.grid_field_timeFormat.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.grid_field_timeFormat.tr()),
margin: GridSize.typeOptionContentInsets,
onTap: onTap,
onHover: onHover,
@@ -177,8 +175,7 @@ class _IncludeTimeButton extends StatelessWidget {
padding: GridSize.typeOptionContentInsets,
child: Row(
children: [
- FlowyText.medium(LocaleKeys.grid_field_includeTime.tr(),
- fontSize: 12),
+ FlowyText.medium(LocaleKeys.grid_field_includeTime.tr()),
const Spacer(),
Toggle(
value: includeTime,
@@ -254,7 +251,7 @@ class DateFormatCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(dateFormat.title(), fontSize: 12),
+ text: FlowyText.medium(dateFormat.title()),
rightIcon: checkmark,
onTap: () => onSelected(dateFormat),
),
@@ -336,7 +333,7 @@ class TimeFormatCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(timeFormat.title(), fontSize: 12),
+ text: FlowyText.medium(timeFormat.title()),
rightIcon: checkmark,
onTap: () => onSelected(timeFormat),
),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart
index f5061e1204..8fc17ee548 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart
@@ -72,12 +72,10 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
),
text: Row(
children: [
- FlowyText.medium(LocaleKeys.grid_field_numberFormat.tr(),
- fontSize: 12),
+ FlowyText.medium(LocaleKeys.grid_field_numberFormat.tr()),
// const HSpace(6),
const Spacer(),
- FlowyText.regular(state.typeOption.format.title(),
- fontSize: 12),
+ FlowyText.regular(state.typeOption.format.title()),
],
),
),
@@ -173,7 +171,7 @@ class NumberFormatCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(format.title(), fontSize: 12),
+ text: FlowyText.medium(format.title()),
onTap: () => onSelected(format),
rightIcon: checkmark,
),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
index a44ed2db8c..7f60a92e2d 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
@@ -72,7 +72,6 @@ class OptionTitle extends StatelessWidget {
List<Widget> children = [
FlowyText.medium(
LocaleKeys.grid_field_optionTitle.tr(),
- fontSize: 12,
color: Theme.of(context).hintColor,
)
];
@@ -101,7 +100,6 @@ class _OptionTitleButton extends StatelessWidget {
child: FlowyButton(
text: FlowyText.medium(
LocaleKeys.grid_field_addOption.tr(),
- fontSize: 12,
textAlign: TextAlign.center,
),
onTap: () {
@@ -232,8 +230,7 @@ class _AddOptionButton extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.grid_field_addSelectOption.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.grid_field_addSelectOption.tr()),
onTap: () {
context
.read<SelectOptionTypeOptionBloc>()
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart
index 45e1c3ac89..0ce9dba994 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart
@@ -1,7 +1,6 @@
import 'package:app_flowy/plugins/grid/application/field/type_option/edit_select_option_bloc.dart';
import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart';
import 'package:flowy_infra/image.dart';
-import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@@ -86,8 +85,7 @@ class _DeleteTag extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.grid_selectOption_deleteTag.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.grid_selectOption_deleteTag.tr()),
leftIcon: svgWidget(
"grid/delete",
color: Theme.of(context).colorScheme.onSurface,
@@ -145,7 +143,6 @@ class SelectOptionColorList extends StatelessWidget {
height: GridSize.typeOptionItemHeight,
child: FlowyText.medium(
LocaleKeys.grid_selectOption_colorPanelTitle.tr(),
- fontSize: FontSizes.s12,
textAlign: TextAlign.left,
color: Theme.of(context).hintColor,
),
@@ -195,7 +192,7 @@ class _SelectOptionColorCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(color.optionName(), fontSize: 12),
+ text: FlowyText.medium(color.optionName()),
leftIcon: colorIcon,
rightIcon: checkmark,
onTap: () {
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart
index 3182ae85a4..c04145a88c 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart
@@ -60,7 +60,6 @@ class _RowActionCell extends StatelessWidget {
child: FlowyButton(
text: FlowyText.medium(
action.title(),
- fontSize: 12,
color: action.enable() ? null : Theme.of(context).disabledColor,
),
onTap: () {
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart
index d8f7786ca1..22066163f9 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart
@@ -198,10 +198,7 @@ class _CreateFieldButtonState extends State<_CreateFieldButton> {
height: 40,
decoration: _makeBoxDecoration(context),
child: FlowyButton(
- text: FlowyText.medium(
- LocaleKeys.grid_field_newColumn.tr(),
- fontSize: 12,
- ),
+ text: FlowyText.medium(LocaleKeys.grid_field_newColumn.tr()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () {},
leftIcon: svgWidget("home/add"),
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_group.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_group.dart
index cba82dc8ad..bc31e820e0 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_group.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_group.dart
@@ -81,7 +81,7 @@ class _GridGroupCell extends StatelessWidget {
return SizedBox(
height: GridSize.typeOptionItemHeight,
child: FlowyButton(
- text: FlowyText.medium(fieldContext.name, fontSize: 12),
+ text: FlowyText.medium(fieldContext.name),
leftIcon: svgWidget(
fieldContext.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart
index 1c3fa4a5a0..2e8113d016 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart
@@ -118,7 +118,7 @@ class _GridPropertyCell extends StatelessWidget {
offset: const Offset(20, 0),
constraints: BoxConstraints.loose(const Size(240, 400)),
child: FlowyButton(
- text: FlowyText.medium(fieldContext.name, fontSize: 12),
+ text: FlowyText.medium(fieldContext.name),
leftIcon: svgWidget(
fieldContext.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart
index 14eee6f665..1235417f52 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_setting.dart
@@ -100,7 +100,6 @@ class _SettingItem extends StatelessWidget {
isSelected: isSelected,
text: FlowyText.medium(
action.title(),
- fontSize: 12,
color: action.enable() ? null : Theme.of(context).disabledColor,
),
onTap: () {
diff --git a/frontend/app_flowy/lib/plugins/trash/menu.dart b/frontend/app_flowy/lib/plugins/trash/menu.dart
index ec9e4e998f..d68dce31f9 100644
--- a/frontend/app_flowy/lib/plugins/trash/menu.dart
+++ b/frontend/app_flowy/lib/plugins/trash/menu.dart
@@ -39,7 +39,7 @@ class MenuTrash extends StatelessWidget {
),
),
const HSpace(6),
- FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12),
+ FlowyText.medium(LocaleKeys.trash_text.tr()),
],
);
}
diff --git a/frontend/app_flowy/lib/plugins/trash/src/trash_cell.dart b/frontend/app_flowy/lib/plugins/trash/src/trash_cell.dart
index f7bf3bc7f4..e6cb2e719b 100644
--- a/frontend/app_flowy/lib/plugins/trash/src/trash_cell.dart
+++ b/frontend/app_flowy/lib/plugins/trash/src/trash_cell.dart
@@ -25,14 +25,17 @@ class TrashCell extends StatelessWidget {
return Row(
children: [
SizedBox(
- width: TrashSizes.fileNameWidth,
- child: FlowyText(object.name, fontSize: 12)),
+ width: TrashSizes.fileNameWidth,
+ child: FlowyText(object.name),
+ ),
SizedBox(
- width: TrashSizes.lashModifyWidth,
- child: FlowyText(dateFormatter(object.modifiedTime), fontSize: 12)),
+ width: TrashSizes.lashModifyWidth,
+ child: FlowyText(dateFormatter(object.modifiedTime)),
+ ),
SizedBox(
- width: TrashSizes.createTimeWidth,
- child: FlowyText(dateFormatter(object.createTime), fontSize: 12)),
+ width: TrashSizes.createTimeWidth,
+ child: FlowyText(dateFormatter(object.createTime)),
+ ),
const Spacer(),
FlowyIconButton(
width: 26,
diff --git a/frontend/app_flowy/lib/plugins/trash/src/trash_header.dart b/frontend/app_flowy/lib/plugins/trash/src/trash_header.dart
index 4dc27770eb..7173a92bb2 100644
--- a/frontend/app_flowy/lib/plugins/trash/src/trash_header.dart
+++ b/frontend/app_flowy/lib/plugins/trash/src/trash_header.dart
@@ -57,7 +57,6 @@ class TrashHeader extends StatelessWidget {
width: item.width,
child: FlowyText(
item.title,
- fontSize: 12,
color: Theme.of(context).disabledColor,
),
),
diff --git a/frontend/app_flowy/lib/plugins/trash/trash.dart b/frontend/app_flowy/lib/plugins/trash/trash.dart
index 0cc1e79e44..0b774deb82 100644
--- a/frontend/app_flowy/lib/plugins/trash/trash.dart
+++ b/frontend/app_flowy/lib/plugins/trash/trash.dart
@@ -49,8 +49,7 @@ class TrashPlugin extends Plugin {
class TrashPluginDisplay extends PluginDisplay {
@override
- Widget get leftBarItem =>
- FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12);
+ Widget get leftBarItem => FlowyText.medium(LocaleKeys.trash_text.tr());
@override
Widget? get rightBarItem => null;
diff --git a/frontend/app_flowy/lib/plugins/trash/trash_page.dart b/frontend/app_flowy/lib/plugins/trash/trash_page.dart
index 7b8a07ce46..13771c5a73 100644
--- a/frontend/app_flowy/lib/plugins/trash/trash_page.dart
+++ b/frontend/app_flowy/lib/plugins/trash/trash_page.dart
@@ -4,6 +4,7 @@ import 'package:app_flowy/plugins/trash/src/trash_header.dart';
import 'package:app_flowy/startup/startup.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
+import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_scroll_bar.dart';
@@ -86,12 +87,14 @@ class _TrashPageState extends State<TrashPage> {
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- FlowyText.semibold(LocaleKeys.trash_text.tr()),
+ FlowyText.semibold(
+ LocaleKeys.trash_text.tr(),
+ fontSize: FontSizes.s16,
+ ),
const Spacer(),
IntrinsicWidth(
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.trash_restoreAll.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.trash_restoreAll.tr()),
leftIcon: svgWidget(
'editor/restore',
color: Theme.of(context).colorScheme.onSurface,
@@ -104,8 +107,7 @@ class _TrashPageState extends State<TrashPage> {
const HSpace(6),
IntrinsicWidth(
child: FlowyButton(
- text: FlowyText.medium(LocaleKeys.trash_deleteAll.tr(),
- fontSize: 12),
+ text: FlowyText.medium(LocaleKeys.trash_deleteAll.tr()),
leftIcon: svgWidget(
'editor/delete',
color: Theme.of(context).colorScheme.onSurface,
diff --git a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
index 6d78da638c..cfb135a55c 100644
--- a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
+++ b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
@@ -100,7 +100,6 @@ class SignUpPrompt extends StatelessWidget {
children: [
FlowyText.medium(
LocaleKeys.signIn_dontHaveAnAccount.tr(),
- fontSize: FontSizes.s12,
color: Theme.of(context).hintColor,
),
TextButton(
diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart
index 53ff979ff8..5b278a590b 100644
--- a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart
@@ -169,7 +169,6 @@ class AppActionList extends StatelessWidget {
selector: (state) => state.app,
builder: (context, app) => FlowyText.medium(
app.name,
- fontSize: 12,
overflow: TextOverflow.ellipsis,
),
),
diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart
index 3938eeb3f3..e89b5e60ad 100644
--- a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart
@@ -87,7 +87,6 @@ class ViewSectionItem extends StatelessWidget {
Expanded(
child: FlowyText.regular(
state.view.name,
- fontSize: 12,
overflow: TextOverflow.ellipsis,
),
),
diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart
index 37271417e4..812e648a62 100644
--- a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart
@@ -67,7 +67,6 @@ class MenuUser extends StatelessWidget {
}
return FlowyText.medium(
name,
- fontSize: FontSizes.s12,
overflow: TextOverflow.ellipsis,
);
}
diff --git a/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart b/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart
index 60c4a7bc73..9680072f20 100644
--- a/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/home/navigation.dart
@@ -191,7 +191,10 @@ class EllipsisNaviItem extends NavigationItem {
});
@override
- Widget get leftBarItem => const FlowyText.medium('...');
+ Widget get leftBarItem => FlowyText.medium(
+ '...',
+ fontSize: FontSizes.s16,
+ );
@override
NavigationCallback get action => (id) {};
diff --git a/frontend/app_flowy/lib/workspace/presentation/home/toast.dart b/frontend/app_flowy/lib/workspace/presentation/home/toast.dart
index d3473adaa9..57ebf4636a 100644
--- a/frontend/app_flowy/lib/workspace/presentation/home/toast.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/home/toast.dart
@@ -1,4 +1,5 @@
import 'package:app_flowy/startup/startup.dart';
+import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
@@ -16,7 +17,11 @@ class FlowyMessageToast extends StatelessWidget {
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
- child: FlowyText.medium(message, color: Colors.white),
+ child: FlowyText.medium(
+ message,
+ color: Colors.white,
+ fontSize: FontSizes.s16,
+ ),
),
);
}
diff --git a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_user_view.dart b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_user_view.dart
index a3fba334cd..70b5fc4eef 100644
--- a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_user_view.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_user_view.dart
@@ -1,4 +1,5 @@
import 'package:app_flowy/startup/startup.dart';
+import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:app_flowy/workspace/application/user/settings_user_bloc.dart';
@@ -93,7 +94,10 @@ class _CurrentIcon extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return SimpleDialog(
- title: const FlowyText.medium('Select an Icon'),
+ title: FlowyText.medium(
+ 'Select an Icon',
+ fontSize: FontSizes.s16,
+ ),
children: <Widget>[
SizedBox(
height: 300, width: 300, child: IconGallery(_setIcon))
diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
index 89e2d6ab06..f8b91ae513 100644
--- a/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/widgets/dialogs.dart
@@ -46,8 +46,11 @@ class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
...[
- FlowyText.medium(widget.title,
- color: Theme.of(context).disabledColor),
+ FlowyText.medium(
+ widget.title,
+ color: Theme.of(context).disabledColor,
+ fontSize: FontSizes.s16,
+ ),
VSpace(Insets.sm * 1.5),
],
FlowyFormTextInput(
@@ -117,6 +120,7 @@ class _CreateFlowyAlertDialog extends State<NavigatorAlertDialog> {
...[
FlowyText.medium(
widget.title,
+ fontSize: FontSizes.s16,
color: Theme.of(context).disabledColor,
),
],
@@ -164,13 +168,16 @@ class NavigatorOkCancelDialog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (title != null) ...[
- FlowyText.medium(title!.toUpperCase()),
+ FlowyText.medium(
+ title!.toUpperCase(),
+ fontSize: FontSizes.s16,
+ ),
VSpace(Insets.sm * 1.5),
Container(
color: Theme.of(context).colorScheme.surfaceVariant, height: 1),
VSpace(Insets.m * 1.5),
],
- FlowyText.medium(message, fontSize: FontSizes.s12),
+ FlowyText.medium(message),
SizedBox(height: Insets.l),
OkCancelButton(
onOkPressed: () {
diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart
index 91d788368e..b211a3a8a3 100644
--- a/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart
@@ -3,7 +3,6 @@ import 'package:app_flowy/workspace/presentation/home/toast.dart';
import 'package:app_flowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
-import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
@@ -125,7 +124,6 @@ class FlowyVersionDescription extends CustomActionCell {
if (snapshot.hasError) {
return FlowyText(
"Error: ${snapshot.error}",
- fontSize: FontSizes.s12,
color: Theme.of(context).disabledColor,
);
}
@@ -148,7 +146,6 @@ class FlowyVersionDescription extends CustomActionCell {
const VSpace(6),
FlowyText(
"$appName $version.$buildNumber",
- fontSize: FontSizes.s12,
color: Theme.of(context).hintColor,
),
],
@@ -171,7 +168,7 @@ class BubbleActionWrapper extends ActionCell {
BubbleActionWrapper(this.inner);
@override
- Widget? icon(Color iconColor) => FlowyText.regular(inner.emoji, fontSize: 12);
+ Widget? icon(Color iconColor) => FlowyText.regular(inner.emoji);
@override
String get name => inner.name;
diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_action.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_action.dart
index 8e8fe5d260..2acd2dd14f 100644
--- a/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_action.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/widgets/pop_up_action.dart
@@ -127,7 +127,6 @@ class ActionCellWidget<T extends PopoverAction> extends StatelessWidget {
Expanded(
child: FlowyText.medium(
actionCell.name,
- fontSize: 12,
overflow: TextOverflow.visible,
),
),
diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/text.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/text.dart
index 9db5b768f9..b6bc836487 100644
--- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/text.dart
+++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/text.dart
@@ -1,11 +1,10 @@
-import 'package:flowy_infra/text_style.dart';
import 'package:flutter/material.dart';
class FlowyText extends StatelessWidget {
final String title;
final TextOverflow? overflow;
- final double fontSize;
- final FontWeight fontWeight;
+ final double? fontSize;
+ final FontWeight? fontWeight;
final TextAlign? textAlign;
final int? maxLines;
final Color? color;
@@ -14,28 +13,28 @@ class FlowyText extends StatelessWidget {
this.title, {
Key? key,
this.overflow = TextOverflow.clip,
- this.fontSize = 16,
- this.fontWeight = FontWeight.w400,
+ this.fontSize,
+ this.fontWeight,
this.textAlign,
this.color,
this.maxLines = 1,
}) : super(key: key);
- const FlowyText.semibold(
+ const FlowyText.regular(
this.title, {
Key? key,
- this.fontSize = 16,
+ this.fontSize,
this.overflow,
this.color,
this.textAlign,
this.maxLines = 1,
- }) : fontWeight = FontWeight.w600,
+ }) : fontWeight = FontWeight.w400,
super(key: key);
const FlowyText.medium(
this.title, {
Key? key,
- this.fontSize = 16,
+ this.fontSize,
this.overflow,
this.color,
this.textAlign,
@@ -43,15 +42,15 @@ class FlowyText extends StatelessWidget {
}) : fontWeight = FontWeight.w500,
super(key: key);
- const FlowyText.regular(
+ const FlowyText.semibold(
this.title, {
Key? key,
- this.fontSize = 16,
+ this.fontSize,
this.overflow,
this.color,
this.textAlign,
this.maxLines = 1,
- }) : fontWeight = FontWeight.w400,
+ }) : fontWeight = FontWeight.w600,
super(key: key);
@override
@@ -61,11 +60,11 @@ class FlowyText extends StatelessWidget {
maxLines: maxLines,
textAlign: textAlign,
overflow: overflow ?? TextOverflow.clip,
- style: TextStyles.general(
- fontSize: fontSize,
- fontWeight: fontWeight,
- color: color,
- ),
+ style: Theme.of(context).textTheme.bodyMedium!.copyWith(
+ fontSize: fontSize,
+ fontWeight: fontWeight,
+ color: color,
+ ),
);
}
}
diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart
index 936993dd6c..7686dabea0 100644
--- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart
+++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_button.dart
@@ -1,5 +1,5 @@
import 'package:flowy_infra/size.dart';
-import 'package:flowy_infra/text_style.dart';
+import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
class RoundedTextButton extends StatelessWidget {
@@ -44,12 +44,10 @@ class RoundedTextButton extends StatelessWidget {
child: SizedBox.expand(
child: TextButton(
onPressed: onPressed,
- child: Text(
+ child: FlowyText.medium(
title ?? '',
- style: TextStyles.general(
- fontSize: fontSize,
- color: textColor,
- ),
+ fontSize: fontSize,
+ color: textColor,
),
),
),