Skip to content

Commit a7ce21e

Browse files
authored
fix: mobile board card title not updating (#4110)
1 parent 05bdd05 commit a7ce21e

File tree

1 file changed

+21
-28
lines changed

1 file changed

+21
-28
lines changed

frontend/appflowy_flutter/lib/mobile/presentation/database/card/card_content/mobile_card_content.dart

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import 'package:appflowy/plugins/database_view/application/cell/cell_service.dar
44
import 'package:appflowy/plugins/database_view/widgets/card/card.dart';
55
import 'package:appflowy/plugins/database_view/widgets/card/card_cell_builder.dart';
66
import 'package:appflowy/plugins/database_view/widgets/card/cells/card_cell.dart';
7-
import 'package:appflowy/plugins/database_view/widgets/row/cells/text_cell/text_cell_bloc.dart';
87
import 'package:easy_localization/easy_localization.dart';
98
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
109
import 'package:flutter/material.dart';
11-
import 'package:flutter_bloc/flutter_bloc.dart';
1210

1311
class MobileCardContent<CustomCardData> extends StatelessWidget {
1412
const MobileCardContent({
@@ -72,33 +70,28 @@ class MobileCardContent<CustomCardData> extends StatelessWidget {
7270
DatabaseCellContext cellContext,
7371
) {
7472
final renderHook = RowCardRenderHook<String>();
75-
renderHook.addTextCellHook((cellData, cardData, __) {
76-
return BlocBuilder<TextCellBloc, TextCellState>(
77-
builder: (context, state) {
78-
final cardDataIsEmpty = cardData == null;
79-
final text = cardDataIsEmpty
80-
? LocaleKeys.grid_row_titlePlaceholder.tr()
81-
: cellData;
82-
final color = cardDataIsEmpty
83-
? Theme.of(context).hintColor
84-
: Theme.of(context).colorScheme.onBackground;
73+
renderHook.addTextCellHook((cellData, cardData, context) {
74+
final text = cellData.isEmpty
75+
? LocaleKeys.grid_row_titlePlaceholder.tr()
76+
: cellData;
77+
final color = cellData.isEmpty
78+
? Theme.of(context).hintColor
79+
: Theme.of(context).colorScheme.onBackground;
8580

86-
return Row(
87-
children: [
88-
if (!cellContext.rowMeta.isDocumentEmpty) ...[
89-
const FlowySvg(FlowySvgs.notes_s),
90-
const HSpace(4),
91-
],
92-
Expanded(
93-
child: FlowyText.regular(
94-
text,
95-
color: color,
96-
overflow: TextOverflow.ellipsis,
97-
),
98-
),
99-
],
100-
);
101-
},
81+
return Row(
82+
children: [
83+
if (!cellContext.rowMeta.isDocumentEmpty) ...[
84+
const FlowySvg(FlowySvgs.notes_s),
85+
const HSpace(4),
86+
],
87+
Expanded(
88+
child: FlowyText.medium(
89+
text,
90+
color: color,
91+
overflow: TextOverflow.ellipsis,
92+
),
93+
),
94+
],
10295
);
10396
});
10497

0 commit comments

Comments
 (0)