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.

feat(flutter_desktop): use regular rather than medium font weight by default (#6432)

Richard Shiue7ac3b72a4f29
diff --git a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/board_page.dart b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/board_page.dart
index d3c2c00a43..8ba4cde4c2 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/board_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/board_page.dart
@@ -521,7 +521,7 @@ class _BoardColumnFooterState extends State<BoardColumnFooter> {
FlowySvgs.add_s,
color: Theme.of(context).hintColor,
),
- text: FlowyText.medium(
+ text: FlowyText(
LocaleKeys.board_column_createNewCard.tr(),
color: Theme.of(context).hintColor,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_column_header.dart b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_column_header.dart
index aff7a9e507..7039dbe8b8 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_column_header.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_column_header.dart
@@ -118,7 +118,7 @@ class GroupOptionsButton extends StatelessWidget {
height: GridSize.popoverItemHeight,
child: FlowyButton(
leftIcon: FlowySvg(action.icon),
- text: FlowyText.medium(
+ text: FlowyText(
action.text,
lineHeight: 1.0,
overflow: TextOverflow.ellipsis,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_hidden_groups.dart b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_hidden_groups.dart
index 4c55205b21..7edcbd9d49 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_hidden_groups.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/board/presentation/widgets/board_hidden_groups.dart
@@ -279,14 +279,14 @@ class HiddenGroupButtonContent extends StatelessWidget {
index: index,
),
const HSpace(4),
- FlowyText.medium(
+ FlowyText(
group
.generateGroupName(bloc.databaseController),
overflow: TextOverflow.ellipsis,
),
const HSpace(6),
Expanded(
- child: FlowyText.medium(
+ child: FlowyText(
group.rows.length.toString(),
overflow: TextOverflow.ellipsis,
color: Theme.of(context).hintColor,
@@ -387,7 +387,7 @@ class HiddenGroupPopupItemList extends StatelessWidget {
final cells = <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
- child: FlowyText.medium(
+ child: FlowyText(
group.generateGroupName(bloc.databaseController),
fontSize: 10,
color: Theme.of(context).hintColor,
@@ -471,7 +471,7 @@ class HiddenGroupPopupItem extends StatelessWidget {
text: cellBuilder.build(
cellContext: cellContext,
styleMap: {FieldType.RichText: _titleCellStyle(context)},
- hasNotes: !rowMeta.isDocumentEmpty,
+ hasNotes: false,
),
onTap: onPressed,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_day.dart b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_day.dart
index 683dd89d75..3cd6899b09 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_day.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_day.dart
@@ -326,7 +326,7 @@ class _DayBadge extends StatelessWidget {
width: isToday ? size : null,
height: isToday ? size : null,
child: Center(
- child: FlowyText.medium(
+ child: FlowyText(
dayString,
fontSize: UniversalPlatform.isMobile ? 12 : 11,
color: dayTextColor,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_page.dart b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_page.dart
index ca117bb20f..41d9535946 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_page.dart
@@ -453,7 +453,7 @@ class _UnscheduledEventsButtonState extends State<UnscheduledEventsButton> {
builder: (_) {
return Column(
children: [
- FlowyText.medium(
+ FlowyText(
LocaleKeys.calendar_settings_unscheduledEventsTitle.tr(),
),
UnscheduleEventsList(
@@ -482,7 +482,7 @@ class UnscheduleEventsList extends StatelessWidget {
if (!UniversalPlatform.isMobile)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
- child: FlowyText.medium(
+ child: FlowyText(
LocaleKeys.calendar_settings_clickToAdd.tr(),
fontSize: 10,
color: Theme.of(context).hintColor,
@@ -565,7 +565,7 @@ class DesktopUnscheduledEventTile extends StatelessWidget {
height: 26,
child: FlowyButton(
margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
- text: FlowyText.medium(
+ text: FlowyText(
event.title.isEmpty
? LocaleKeys.calendar_defaultNewCalendarTitle.tr()
: event.title,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/toolbar/calendar_layout_setting.dart b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/toolbar/calendar_layout_setting.dart
index 9c7dd3bcd5..e23b0cd552 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/toolbar/calendar_layout_setting.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/toolbar/calendar_layout_setting.dart
@@ -173,7 +173,7 @@ class LayoutDateField extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
- text: FlowyText.medium(
+ text: FlowyText(
fieldInfo.name,
lineHeight: 1.0,
),
@@ -208,7 +208,7 @@ class LayoutDateField extends StatelessWidget {
height: GridSize.popoverItemHeight,
child: FlowyButton(
margin: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 10.0),
- text: FlowyText.medium(
+ text: FlowyText(
lineHeight: 1.0,
LocaleKeys.calendar_settings_layoutDateField.tr(),
),
@@ -310,7 +310,7 @@ class FirstDayOfWeek extends StatelessWidget {
height: GridSize.popoverItemHeight,
child: FlowyButton(
margin: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 10.0),
- text: FlowyText.medium(
+ text: FlowyText(
lineHeight: 1.0,
LocaleKeys.calendar_settings_firstDayOfWeek.tr(),
),
@@ -331,7 +331,7 @@ Widget _toggleItem({
padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 10.0),
child: Row(
children: [
- FlowyText.medium(text),
+ FlowyText(text),
const Spacer(),
Toggle(
value: value,
@@ -372,7 +372,7 @@ class StartFromButton extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
- text: FlowyText.medium(
+ text: FlowyText(
title,
lineHeight: 1.0,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculation_type_item.dart b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculation_type_item.dart
index 872c9bcf52..b1b696d790 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculation_type_item.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculation_type_item.dart
@@ -22,7 +22,7 @@ class CalculationTypeItem extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
- text: FlowyText.medium(
+ text: FlowyText(
type.label,
overflow: TextOverflow.ellipsis,
lineHeight: 1.0,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/remove_calculation_button.dart b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/remove_calculation_button.dart
index 369d27133e..982ee992b6 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/remove_calculation_button.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/remove_calculation_button.dart
@@ -20,7 +20,7 @@ class RemoveCalculationButton extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
- text: FlowyText.medium(
+ text: FlowyText(
LocaleKeys.grid_calculationTypeLabel_none.tr(),
overflow: TextOverflow.ellipsis,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/tab_bar/desktop/tab_bar_add_button.dart b/frontend/appflowy_flutter/lib/plugins/database/tab_bar/desktop/tab_bar_add_button.dart
index 72d26bca4f..e91e739b97 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/tab_bar/desktop/tab_bar_add_button.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/tab_bar/desktop/tab_bar_add_button.dart
@@ -103,7 +103,7 @@ class TabBarAddButtonActionCell extends StatelessWidget {
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
- text: FlowyText.medium(
+ text: FlowyText(
'${LocaleKeys.grid_createView.tr()} ${action.layoutName}',
color: AFThemeExtension.of(context).textColor,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/tab_bar/mobile/mobile_tab_bar_header.dart b/frontend/appflowy_flutter/lib/plugins/database/tab_bar/mobile/mobile_tab_bar_header.dart
index 76f77adb60..4d1d386477 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/tab_bar/mobile/mobile_tab_bar_header.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/tab_bar/mobile/mobile_tab_bar_header.dart
@@ -104,7 +104,7 @@ class _DatabaseViewSelectorButton extends StatelessWidget {
Flexible(
child: FlowyText.medium(
tabBar.view.name,
- fontSize: 13,
+ fontSize: 14,
overflow: TextOverflow.ellipsis,
),
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_relation_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_relation_cell.dart
index 80649f6a02..e1f873083c 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_relation_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_relation_cell.dart
@@ -54,7 +54,7 @@ class DesktopGridRelationCellSkin extends IEditableRelationCellSkin {
children: rows.map(
(row) {
final isEmpty = row.name.isEmpty;
- return FlowyText.medium(
+ return FlowyText(
isEmpty ? LocaleKeys.grid_row_titlePlaceholder.tr() : row.name,
color: isEmpty ? Theme.of(context).hintColor : null,
decoration: TextDecoration.underline,
@@ -81,7 +81,7 @@ class DesktopGridRelationCellSkin extends IEditableRelationCellSkin {
children: rows.map(
(row) {
final isEmpty = row.name.isEmpty;
- return FlowyText.medium(
+ return FlowyText(
isEmpty ? LocaleKeys.grid_row_titlePlaceholder.tr() : row.name,
color: isEmpty ? Theme.of(context).hintColor : null,
decoration: TextDecoration.underline,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_text_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_text_cell.dart
index 97af0f13df..5c8fae8b1c 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_text_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_grid/desktop_grid_text_cell.dart
@@ -28,7 +28,15 @@ class DesktopGridTextCellSkin extends IEditableTextCellSkin {
controller: textEditingController,
focusNode: focusNode,
maxLines: context.watch<TextCellBloc>().state.wrap ? null : 1,
- style: Theme.of(context).textTheme.bodyMedium,
+ style: Theme.of(context).textTheme.bodyMedium?.copyWith(
+ fontWeight: context
+ .read<TextCellBloc>()
+ .cellController
+ .fieldInfo
+ .isPrimary
+ ? FontWeight.w500
+ : null,
+ ),
decoration: const InputDecoration(
contentPadding: EdgeInsets.only(top: 4),
border: InputBorder.none,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_date_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_date_cell.dart
index 94e0159a02..014621465c 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_date_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_date_cell.dart
@@ -36,7 +36,7 @@ class DesktopRowDetailDateCellSkin extends IEditableDateCellSkin {
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
- child: FlowyText.medium(
+ child: FlowyText(
text,
color: color,
overflow: TextOverflow.ellipsis,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_media_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_media_cell.dart
index 2b8b2293c5..97b5ed8ac8 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_media_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_media_cell.dart
@@ -81,7 +81,7 @@ class DekstopRowDetailMediaCellSkin extends IEditableMediaCellSkin {
horizontal: 8,
vertical: 6,
),
- child: FlowyText.medium(
+ child: FlowyText(
LocaleKeys.grid_row_textPlaceholder.tr(),
color: Theme.of(context).hintColor,
overflow: TextOverflow.ellipsis,
@@ -542,7 +542,7 @@ class _FilePreviewRenderState extends State<_FilePreviewRender> {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Center(
- child: FlowyText.medium(
+ child: FlowyText(
file.name,
overflow: TextOverflow.ellipsis,
fontSize: 12,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_relation_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_relation_cell.dart
index e481d33cd5..cefa11c7fc 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_relation_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_relation_cell.dart
@@ -56,7 +56,7 @@ class DesktopRowDetailRelationCellSkin extends IEditableRelationCellSkin {
children: rows.map(
(row) {
final isEmpty = row.name.isEmpty;
- return FlowyText.medium(
+ return FlowyText(
isEmpty ? LocaleKeys.grid_row_titlePlaceholder.tr() : row.name,
color: isEmpty ? Theme.of(context).hintColor : null,
decoration: TextDecoration.underline,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_timestamp_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_timestamp_cell.dart
index ac0d3ea033..af212c6dfd 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_timestamp_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/desktop_row_detail/desktop_row_detail_timestamp_cell.dart
@@ -16,7 +16,7 @@ class DesktopRowDetailTimestampCellSkin extends IEditableTimestampCellSkin {
return Container(
alignment: AlignmentDirectional.centerStart,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6.0),
- child: FlowyText.medium(
+ child: FlowyText(
state.dateStr,
maxLines: null,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/mobile_row_detail/mobile_row_detail_timestamp_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/mobile_row_detail/mobile_row_detail_timestamp_cell.dart
index 2ca0a40b62..7ddda492c9 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/mobile_row_detail/mobile_row_detail_timestamp_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/mobile_row_detail/mobile_row_detail_timestamp_cell.dart
@@ -27,7 +27,7 @@ class MobileRowDetailTimestampCellSkin extends IEditableTimestampCellSkin {
borderRadius: const BorderRadius.all(Radius.circular(14)),
),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 13),
- child: FlowyText.medium(
+ child: FlowyText(
state.dateStr.isEmpty
? LocaleKeys.grid_row_textPlaceholder.tr()
: state.dateStr,
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell_editor/mobile_select_option_editor.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell_editor/mobile_select_option_editor.dart
index 8f7e1c5a3c..bd84c9074d 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell_editor/mobile_select_option_editor.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell_editor/mobile_select_option_editor.dart
@@ -391,7 +391,7 @@ class _CreateOptionCell extends StatelessWidget {
onTap: onTap,
child: Row(
children: [
- FlowyText.medium(
+ FlowyText(
LocaleKeys.grid_selectOption_create.tr(),
color: Theme.of(context).hintColor,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_property.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_property.dart
index 5ea4cc8112..ad6b105488 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_property.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_property.dart
@@ -344,7 +344,7 @@ class ToggleHiddenFieldsVisibilityButton extends StatelessWidget {
EdgeInsets.symmetric(vertical: 14, horizontal: 6),
),
),
- label: FlowyText.medium(
+ label: FlowyText(
text,
fontSize: 15,
color: Theme.of(context).hintColor,
diff --git a/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/base_appearance.dart b/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/base_appearance.dart
index 8e2cea87c7..6be53cf158 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/base_appearance.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/base_appearance.dart
@@ -2,7 +2,6 @@ import 'package:appflowy/shared/google_fonts_extension.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flutter/material.dart';
-import 'package:universal_platform/universal_platform.dart';
// the default font family is empty, so we can use the default font family of the platform
// the system will choose the default font family of the platform
@@ -31,8 +30,7 @@ abstract class BaseAppearance {
double? lineHeight,
}) {
fontSize = fontSize ?? FontSizes.s14;
- fontWeight = fontWeight ??
- (UniversalPlatform.isDesktopOrWeb ? FontWeight.w500 : FontWeight.w400);
+ fontWeight = fontWeight ?? FontWeight.w400;
letterSpacing = fontSize * (letterSpacing ?? 0.005);
final textStyle = TextStyle(
diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart
index e6db87070b..38469e1c6c 100644
--- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart
+++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
-import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
@@ -390,13 +389,10 @@ class FlowyTextButton extends StatelessWidget {
children.add(heading!);
children.add(const HSpace(8));
}
- children.add(FlowyText(
+ children.add(Text(
text,
overflow: overflow,
- color: fontColor ?? Theme.of(context).colorScheme.onPrimary,
textAlign: TextAlign.center,
- lineHeight: lineHeight,
- fontSize: fontSize,
));
Widget child = Row(
@@ -431,6 +427,7 @@ class FlowyTextButton extends StatelessWidget {
TextStyle(
fontWeight: fontWeight ?? FontWeight.w500,
fontSize: fontSize,
+ color: fontColor ?? Theme.of(context).colorScheme.onPrimary,
decoration: decoration,
fontFamily: fontFamily,
height: lineHeight ?? 1.1,