mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-11-03 19:43:52 +00:00 
			
		
		
		
	fix: mobile board card title not updating (#4110)
This commit is contained in:
		
							parent
							
								
									05bdd052ab
								
							
						
					
					
						commit
						a7ce21e941
					
				@ -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,33 +70,28 @@ 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
 | 
			
		||||
              ? LocaleKeys.grid_row_titlePlaceholder.tr()
 | 
			
		||||
              : cellData;
 | 
			
		||||
          final color = cardDataIsEmpty
 | 
			
		||||
              ? Theme.of(context).hintColor
 | 
			
		||||
              : Theme.of(context).colorScheme.onBackground;
 | 
			
		||||
    renderHook.addTextCellHook((cellData, cardData, context) {
 | 
			
		||||
      final text = cellData.isEmpty
 | 
			
		||||
          ? LocaleKeys.grid_row_titlePlaceholder.tr()
 | 
			
		||||
          : cellData;
 | 
			
		||||
      final color = cellData.isEmpty
 | 
			
		||||
          ? Theme.of(context).hintColor
 | 
			
		||||
          : Theme.of(context).colorScheme.onBackground;
 | 
			
		||||
 | 
			
		||||
          return Row(
 | 
			
		||||
            children: [
 | 
			
		||||
              if (!cellContext.rowMeta.isDocumentEmpty) ...[
 | 
			
		||||
                const FlowySvg(FlowySvgs.notes_s),
 | 
			
		||||
                const HSpace(4),
 | 
			
		||||
              ],
 | 
			
		||||
              Expanded(
 | 
			
		||||
                child: FlowyText.regular(
 | 
			
		||||
                  text,
 | 
			
		||||
                  color: color,
 | 
			
		||||
                  overflow: TextOverflow.ellipsis,
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
            ],
 | 
			
		||||
          );
 | 
			
		||||
        },
 | 
			
		||||
      return Row(
 | 
			
		||||
        children: [
 | 
			
		||||
          if (!cellContext.rowMeta.isDocumentEmpty) ...[
 | 
			
		||||
            const FlowySvg(FlowySvgs.notes_s),
 | 
			
		||||
            const HSpace(4),
 | 
			
		||||
          ],
 | 
			
		||||
          Expanded(
 | 
			
		||||
            child: FlowyText.medium(
 | 
			
		||||
              text,
 | 
			
		||||
              color: color,
 | 
			
		||||
              overflow: TextOverflow.ellipsis,
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
      );
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user