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.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix(flutter_desktop): make icon of primary cells align to top (#6328)
Richard Shiuea406dfbc4365
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.dartindex f1f28f6e0c..9afd6a4d4c 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@@ -141,9 +141,9 @@ class _TextCellState extends State<TextCardCell> {Widget? _buildIcon(TextCellState state) {if (state.emoji?.value.isNotEmpty ?? false) {- return Text(+ return FlowyText.emoji(+ optimizeEmojiAlign: true,state.emoji?.value ?? '',- style: widget.style.titleTextStyle,);}@@ -185,6 +185,7 @@ class _TextCellState extends State<TextCardCell> {builder: (context, state) {final icon = _buildIcon(state);return Row(+ crossAxisAlignment: CrossAxisAlignment.start,children: [if (icon != null) ...[icon,@@ -222,8 +223,7 @@ class _TextCellState extends State<TextCardCell> {enableInteractiveSelection: isEditing,style: widget.style.titleTextStyle,decoration: InputDecoration(- contentPadding: widget.style.padding- .add(const EdgeInsets.symmetric(vertical: 4.0)),+ contentPadding: widget.style.padding,border: InputBorder.none,enabledBorder: InputBorder.none,isDense: true,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.dartindex 8345cadc59..97af0f13df 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@@ -20,6 +20,7 @@ class DesktopGridTextCellSkin extends IEditableTextCellSkin {return Padding(padding: GridSize.cellContentInsets,child: Row(+ crossAxisAlignment: CrossAxisAlignment.start,children: [const _IconOrEmoji(),Expanded(@@ -29,6 +30,7 @@ class DesktopGridTextCellSkin extends IEditableTextCellSkin {maxLines: context.watch<TextCellBloc>().state.wrap ? null : 1,style: Theme.of(context).textTheme.bodyMedium,decoration: const InputDecoration(+ contentPadding: EdgeInsets.only(top: 4),border: InputBorder.none,focusedBorder: InputBorder.none,enabledBorder: InputBorder.none,@@ -52,39 +54,38 @@ class _IconOrEmoji extends StatelessWidget {Widget build(BuildContext context) {return BlocBuilder<TextCellBloc, TextCellState>(builder: (context, state) {- return Row(- mainAxisSize: MainAxisSize.min,- children: [- if (state.emoji != null)- ValueListenableBuilder<String>(- valueListenable: state.emoji!,- builder: (context, value, child) {- if (value.isEmpty) {- return const SizedBox.shrink();- } else {- return FlowyText(- value,- fontSize: 16,- );- }- },- ),- if (state.hasDocument != null)- ValueListenableBuilder<bool>(- valueListenable: state.hasDocument!,- builder: (context, hasDocument, child) {- if ((state.emoji?.value.isEmpty ?? true) && hasDocument) {- return FlowySvg(- FlowySvgs.notes_s,- color: Theme.of(context).hintColor,- );- } else {- return const SizedBox.shrink();- }- },- ),- const HSpace(6),- ],+ // if not a title cell, return empty widget+ if (state.emoji == null || state.hasDocument == null) {+ return const SizedBox.shrink();+ }++ return ValueListenableBuilder<String>(+ valueListenable: state.emoji!,+ builder: (context, emoji, _) {+ return emoji.isNotEmpty+ ? Padding(+ padding: const EdgeInsetsDirectional.only(end: 6.0),+ child: FlowyText.emoji(+ optimizeEmojiAlign: true,+ emoji,+ ),+ )+ : ValueListenableBuilder<bool>(+ valueListenable: state.hasDocument!,+ builder: (context, hasDocument, _) {+ return hasDocument+ ? Padding(+ padding:+ const EdgeInsetsDirectional.only(end: 6.0),+ child: FlowySvg(+ FlowySvgs.notes_s,+ color: Theme.of(context).hintColor,+ ),+ )+ : const SizedBox.shrink();+ },+ );+ },);},);