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.

fix: kanban card icon not displaying (#5181)

Richard Shiue0b94e2b25dfd
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 f74416b42d..b72b4b083c 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
@@ -12,6 +12,7 @@ import 'package:appflowy/plugins/database/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/database/grid/presentation/widgets/header/field_type_extension.dart';
import 'package:appflowy/plugins/database/tab_bar/desktop/setting_menu.dart';
import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart';
+import 'package:appflowy/plugins/database/widgets/card/card_bloc.dart';
import 'package:appflowy/plugins/database/widgets/cell/card_cell_style_maps/desktop_board_card_cell_style.dart';
import 'package:appflowy/plugins/database/widgets/row/row_detail.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
@@ -278,7 +279,7 @@ class _DesktopBoardContentState extends State<DesktopBoardContent> {
context: context,
databaseController: databaseController,
groupId: groupData.group.groupId,
- rowMeta: rowMeta,
+ rowMeta: context.read<CardBloc>().state.rowMeta,
),
styleConfiguration: RowCardStyleConfiguration(
cellStyleMap: desktopBoardCardCellStyleMap(context),
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/text_card_cell.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/text_card_cell.dart
index a36d539bb1..421cf3b761 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/text_card_cell.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/cell/card_cell_skeleton/text_card_cell.dart
@@ -5,6 +5,7 @@ import 'package:appflowy/plugins/database/application/cell/cell_controller_build
import 'package:appflowy/plugins/database/application/database_controller.dart';
import 'package:appflowy/plugins/database/application/cell/bloc/text_cell_bloc.dart';
import 'package:easy_localization/easy_localization.dart';
+import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -128,20 +129,17 @@ class _TextCellState extends State<TextCardCell> {
return const SizedBox.shrink();
}
+ final icon = _buildIcon(state, isTitle);
final child = state.enableEdit || focusWhenInit
? _buildTextField()
: _buildText(state, isTitle);
return Row(
children: [
- if (isTitle && widget.showNotes)
- FlowyTooltip(
- message: LocaleKeys.board_notesTooltip.tr(),
- child: FlowySvg(
- FlowySvgs.notes_s,
- color: Theme.of(context).hintColor,
- ),
- ),
+ if (icon != null) ...[
+ icon,
+ const HSpace(4.0),
+ ],
Expanded(child: child),
],
);
@@ -158,6 +156,28 @@ class _TextCellState extends State<TextCardCell> {
super.dispose();
}
+ Widget? _buildIcon(TextCellState state, bool isTitle) {
+ if (!isTitle) {
+ return null;
+ }
+ if (state.emoji.isNotEmpty) {
+ return Text(
+ state.emoji,
+ style: widget.style.titleTextStyle,
+ );
+ }
+ if (widget.showNotes) {
+ return FlowyTooltip(
+ message: LocaleKeys.board_notesTooltip.tr(),
+ child: FlowySvg(
+ FlowySvgs.notes_s,
+ color: Theme.of(context).hintColor,
+ ),
+ );
+ }
+ return null;
+ }
+
Widget _buildText(TextCellState state, bool isTitle) {
final text = state.content.isEmpty
? isTitle