fix: mobile board card title not updating (#4110)

This commit is contained in:
Richard Shiue 2023-12-07 09:09:18 +08:00 committed by GitHub
parent 05bdd052ab
commit a7ce21e941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,9 @@ import 'package:appflowy/plugins/database_view/application/cell/cell_service.dar
import 'package:appflowy/plugins/database_view/widgets/card/card.dart';
import 'package:appflowy/plugins/database_view/widgets/card/card_cell_builder.dart';
import 'package:appflowy/plugins/database_view/widgets/card/cells/card_cell.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/text_cell/text_cell_bloc.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class MobileCardContent<CustomCardData> extends StatelessWidget {
const MobileCardContent({
@ -72,14 +70,11 @@ class MobileCardContent<CustomCardData> extends StatelessWidget {
DatabaseCellContext cellContext,
) {
final renderHook = RowCardRenderHook<String>();
renderHook.addTextCellHook((cellData, cardData, __) {
return BlocBuilder<TextCellBloc, TextCellState>(
builder: (context, state) {
final cardDataIsEmpty = cardData == null;
final text = cardDataIsEmpty
renderHook.addTextCellHook((cellData, cardData, context) {
final text = cellData.isEmpty
? LocaleKeys.grid_row_titlePlaceholder.tr()
: cellData;
final color = cardDataIsEmpty
final color = cellData.isEmpty
? Theme.of(context).hintColor
: Theme.of(context).colorScheme.onBackground;
@ -90,7 +85,7 @@ class MobileCardContent<CustomCardData> extends StatelessWidget {
const HSpace(4),
],
Expanded(
child: FlowyText.regular(
child: FlowyText.medium(
text,
color: color,
overflow: TextOverflow.ellipsis,
@ -98,8 +93,6 @@ class MobileCardContent<CustomCardData> extends StatelessWidget {
),
],
);
},
);
});
return Padding(