mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: use theme.of(context) text theme in FlowyText (#1463)
This commit is contained in:
@ -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();
|
||||
|
@ -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>()
|
||||
|
@ -91,7 +91,6 @@ class SelectOptionTag extends StatelessWidget {
|
||||
pressElevation: 1,
|
||||
label: FlowyText.medium(
|
||||
name,
|
||||
fontSize: 12,
|
||||
overflow: TextOverflow.clip,
|
||||
),
|
||||
selectedColor: color,
|
||||
|
@ -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),
|
||||
|
@ -174,7 +174,6 @@ class FieldCellButton extends StatelessWidget {
|
||||
),
|
||||
text: FlowyText.medium(
|
||||
text,
|
||||
fontSize: 12,
|
||||
maxLines: maxLines,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
@ -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: () {
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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),
|
||||
),
|
||||
|
@ -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,
|
||||
),
|
||||
|
@ -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>()
|
||||
|
@ -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: () {
|
||||
|
@ -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: () {
|
||||
|
@ -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"),
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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: () {
|
||||
|
@ -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()),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -57,7 +57,6 @@ class TrashHeader extends StatelessWidget {
|
||||
width: item.width,
|
||||
child: FlowyText(
|
||||
item.title,
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).disabledColor,
|
||||
),
|
||||
),
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user