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(flutter_desktop): incorrect row meta in row detail page (#6329)

Richard Shiue1dedb909e54d
diff --git a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart
index ed783f1b69..4c3c5b438c 100755
--- a/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart
@@ -454,11 +454,6 @@ class _GridRowsState extends State<_GridRows> {
Log.warn('RowMeta is null for rowId: $rowId');
return const SizedBox.shrink();
}
- final rowController = RowController(
- viewId: viewId,
- rowMeta: rowMeta,
- rowCache: rowCache,
- );
final child = GridRow(
key: ValueKey(rowId),
@@ -466,18 +461,31 @@ class _GridRowsState extends State<_GridRows> {
rowId: rowId,
viewId: viewId,
index: index,
- rowController: rowController,
+ rowController: RowController(
+ viewId: viewId,
+ rowMeta: rowMeta,
+ rowCache: rowCache,
+ ),
cellBuilder: EditableCellBuilder(databaseController: databaseController),
openDetailPage: (rowDetailContext) => FlowyOverlay.show(
context: rowDetailContext,
- builder: (_) => BlocProvider.value(
- value: context.read<ViewBloc>(),
- child: RowDetailPage(
- rowController: rowController,
- databaseController: databaseController,
- userProfile: context.read<GridBloc>().userProfile,
- ),
- ),
+ builder: (_) {
+ final rowMeta = rowCache.getRow(rowId)?.rowMeta;
+ return rowMeta == null
+ ? const SizedBox.shrink()
+ : BlocProvider.value(
+ value: context.read<ViewBloc>(),
+ child: RowDetailPage(
+ rowController: RowController(
+ viewId: viewId,
+ rowMeta: rowMeta,
+ rowCache: rowCache,
+ ),
+ databaseController: databaseController,
+ userProfile: context.read<GridBloc>().userProfile,
+ ),
+ );
+ },
),
);