mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: expand row
This commit is contained in:
parent
fa3a28e850
commit
40443ced80
@ -35,13 +35,16 @@ class _CheckboxCellState extends State<CheckboxCell> {
|
|||||||
child: BlocBuilder<CheckboxCellBloc, CheckboxCellState>(
|
child: BlocBuilder<CheckboxCellBloc, CheckboxCellState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final icon = state.isSelected ? svgWidget('editor/editor_check') : svgWidget('editor/editor_uncheck');
|
final icon = state.isSelected ? svgWidget('editor/editor_check') : svgWidget('editor/editor_uncheck');
|
||||||
return Align(
|
return SizedBox(
|
||||||
alignment: Alignment.centerLeft,
|
height: 42,
|
||||||
child: FlowyIconButton(
|
child: Align(
|
||||||
onPressed: () => context.read<CheckboxCellBloc>().add(const CheckboxCellEvent.select()),
|
alignment: Alignment.centerLeft,
|
||||||
iconPadding: EdgeInsets.zero,
|
child: FlowyIconButton(
|
||||||
icon: icon,
|
onPressed: () => context.read<CheckboxCellBloc>().add(const CheckboxCellEvent.select()),
|
||||||
width: 23,
|
iconPadding: EdgeInsets.zero,
|
||||||
|
icon: icon,
|
||||||
|
width: 23,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -64,7 +64,8 @@ class _SingleSelectCellState extends State<SingleSelectCell> {
|
|||||||
if (children.isEmpty && widget.cellStyle != null) {
|
if (children.isEmpty && widget.cellStyle != null) {
|
||||||
children.add(FlowyText.medium(widget.cellStyle!.placeholder, fontSize: 14, color: theme.shader3));
|
children.add(FlowyText.medium(widget.cellStyle!.placeholder, fontSize: 14, color: theme.shader3));
|
||||||
}
|
}
|
||||||
return SizedBox.expand(
|
return SizedBox(
|
||||||
|
height: 69,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
widget.onFocus.value = true;
|
widget.onFocus.value = true;
|
||||||
|
@ -68,18 +68,21 @@ class _GridTextCellState extends State<GridTextCell> {
|
|||||||
},
|
},
|
||||||
buildWhen: (previous, current) => previous.content != current.content,
|
buildWhen: (previous, current) => previous.content != current.content,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return TextField(
|
return SizedBox(
|
||||||
controller: _controller,
|
height: 42,
|
||||||
focusNode: _focusNode,
|
child: TextField(
|
||||||
onChanged: (value) => focusChanged(),
|
controller: _controller,
|
||||||
onEditingComplete: () => _focusNode.unfocus(),
|
focusNode: _focusNode,
|
||||||
maxLines: 1,
|
onChanged: (value) => focusChanged(),
|
||||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
onEditingComplete: () => _focusNode.unfocus(),
|
||||||
decoration: InputDecoration(
|
maxLines: 1,
|
||||||
contentPadding: EdgeInsets.zero,
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||||
border: InputBorder.none,
|
decoration: InputDecoration(
|
||||||
hintText: widget.cellStyle?.placeholder,
|
contentPadding: EdgeInsets.zero,
|
||||||
isDense: true,
|
border: InputBorder.none,
|
||||||
|
hintText: widget.cellStyle?.placeholder,
|
||||||
|
isDense: true,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -48,19 +48,13 @@ class _GridRowWidgetState extends State<GridRowWidget> {
|
|||||||
child: BlocBuilder<RowBloc, RowState>(
|
child: BlocBuilder<RowBloc, RowState>(
|
||||||
buildWhen: (p, c) => p.rowData.height != c.rowData.height,
|
buildWhen: (p, c) => p.rowData.height != c.rowData.height,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final children = [
|
return Row(
|
||||||
const _RowLeading(),
|
children: [
|
||||||
_RowCells(cellCache: widget.cellCache, onExpand: () => onExpandCell(context)),
|
const _RowLeading(),
|
||||||
const _RowTrailing(),
|
Expanded(child: _RowCells(cellCache: widget.cellCache, onExpand: () => _expandRow(context))),
|
||||||
];
|
const _RowTrailing(),
|
||||||
|
],
|
||||||
final child = Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: children,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return SizedBox(height: 42, child: child);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -73,7 +67,7 @@ class _GridRowWidgetState extends State<GridRowWidget> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onExpandCell(BuildContext context) {
|
void _expandRow(BuildContext context) {
|
||||||
final page = RowDetailPage(
|
final page = RowDetailPage(
|
||||||
rowData: widget.rowData,
|
rowData: widget.rowData,
|
||||||
rowCache: widget.rowCache,
|
rowCache: widget.rowCache,
|
||||||
@ -161,11 +155,13 @@ class _RowCells extends StatelessWidget {
|
|||||||
return BlocBuilder<RowBloc, RowState>(
|
return BlocBuilder<RowBloc, RowState>(
|
||||||
buildWhen: (previous, current) => previous.cellDataMap.length != current.cellDataMap.length,
|
buildWhen: (previous, current) => previous.cellDataMap.length != current.cellDataMap.length,
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Row(
|
return IntrinsicHeight(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: _makeCells(context, state.cellDataMap),
|
children: _makeCells(context, state.cellDataMap),
|
||||||
);
|
));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user