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.

feat: expand row

appflowy40443ced8081
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart
index 99fcd4a26f..7a69db02f2 100644
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart
@@ -35,13 +35,16 @@ class _CheckboxCellState extends State<CheckboxCell> {
child: BlocBuilder<CheckboxCellBloc, CheckboxCellState>(
builder: (context, state) {
final icon = state.isSelected ? svgWidget('editor/editor_check') : svgWidget('editor/editor_uncheck');
- return Align(
- alignment: Alignment.centerLeft,
- child: FlowyIconButton(
- onPressed: () => context.read<CheckboxCellBloc>().add(const CheckboxCellEvent.select()),
- iconPadding: EdgeInsets.zero,
- icon: icon,
- width: 23,
+ return SizedBox(
+ height: 42,
+ child: Align(
+ alignment: Alignment.centerLeft,
+ child: FlowyIconButton(
+ onPressed: () => context.read<CheckboxCellBloc>().add(const CheckboxCellEvent.select()),
+ iconPadding: EdgeInsets.zero,
+ icon: icon,
+ width: 23,
+ ),
),
);
},
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/selection_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/selection_cell.dart
index fe10341dcf..5edb3148d1 100644
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/selection_cell.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/selection_cell.dart
@@ -64,7 +64,8 @@ class _SingleSelectCellState extends State<SingleSelectCell> {
if (children.isEmpty && widget.cellStyle != null) {
children.add(FlowyText.medium(widget.cellStyle!.placeholder, fontSize: 14, color: theme.shader3));
}
- return SizedBox.expand(
+ return SizedBox(
+ height: 69,
child: InkWell(
onTap: () {
widget.onFocus.value = true;
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/text_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/text_cell.dart
index 822dc69fb9..a7b548fda5 100644
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/text_cell.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/text_cell.dart
@@ -68,18 +68,21 @@ class _GridTextCellState extends State<GridTextCell> {
},
buildWhen: (previous, current) => previous.content != current.content,
builder: (context, state) {
- return TextField(
- controller: _controller,
- focusNode: _focusNode,
- onChanged: (value) => focusChanged(),
- onEditingComplete: () => _focusNode.unfocus(),
- maxLines: 1,
- style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
- decoration: InputDecoration(
- contentPadding: EdgeInsets.zero,
- border: InputBorder.none,
- hintText: widget.cellStyle?.placeholder,
- isDense: true,
+ return SizedBox(
+ height: 42,
+ child: TextField(
+ controller: _controller,
+ focusNode: _focusNode,
+ onChanged: (value) => focusChanged(),
+ onEditingComplete: () => _focusNode.unfocus(),
+ maxLines: 1,
+ style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.zero,
+ border: InputBorder.none,
+ hintText: widget.cellStyle?.placeholder,
+ isDense: true,
+ ),
),
);
},
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/grid_row.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/grid_row.dart
index eb744af7b2..195899c296 100755
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/grid_row.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/grid_row.dart
@@ -48,19 +48,13 @@ class _GridRowWidgetState extends State<GridRowWidget> {
child: BlocBuilder<RowBloc, RowState>(
buildWhen: (p, c) => p.rowData.height != c.rowData.height,
builder: (context, state) {
- final children = [
- const _RowLeading(),
- _RowCells(cellCache: widget.cellCache, onExpand: () => onExpandCell(context)),
- const _RowTrailing(),
- ];
-
- final child = Row(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: children,
+ return Row(
+ children: [
+ const _RowLeading(),
+ Expanded(child: _RowCells(cellCache: widget.cellCache, onExpand: () => _expandRow(context))),
+ const _RowTrailing(),
+ ],
);
-
- return SizedBox(height: 42, child: child);
},
),
),
@@ -73,7 +67,7 @@ class _GridRowWidgetState extends State<GridRowWidget> {
super.dispose();
}
- void onExpandCell(BuildContext context) {
+ void _expandRow(BuildContext context) {
final page = RowDetailPage(
rowData: widget.rowData,
rowCache: widget.rowCache,
@@ -161,11 +155,13 @@ class _RowCells extends StatelessWidget {
return BlocBuilder<RowBloc, RowState>(
buildWhen: (previous, current) => previous.cellDataMap.length != current.cellDataMap.length,
builder: (context, state) {
- return Row(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.center,
+ return IntrinsicHeight(
+ child: Row(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
children: _makeCells(context, state.cellDataMap),
- );
+ ));
},
);
}