mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: support create new field when editing the row
This commit is contained in:
@ -65,7 +65,10 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
|
||||
alignment: AlignmentDirectional.center,
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Wrap(spacing: 4, runSpacing: 2, children: children),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: Wrap(spacing: 4, runSpacing: 2, children: children),
|
||||
),
|
||||
_SelectOptionDialog(
|
||||
controller: widget.cellControllerBuilder.build(),
|
||||
),
|
||||
|
@ -78,36 +78,38 @@ class _BoardTextCellState extends State<BoardTextCell> {
|
||||
child: BlocBuilder<BoardTextCellBloc, BoardTextCellState>(
|
||||
builder: (context, state) {
|
||||
Widget child;
|
||||
if (state.enableEdit) {
|
||||
child = TextField(
|
||||
controller: _controller,
|
||||
focusNode: focusNode,
|
||||
onChanged: (value) => focusChanged(),
|
||||
onEditingComplete: () => focusNode.unfocus(),
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'Mulish',
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
// Magic number 4 makes the textField take up the same space as FlowyText
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 4),
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
),
|
||||
);
|
||||
if (state.content.isEmpty) {
|
||||
child = const SizedBox();
|
||||
} else {
|
||||
child = FlowyText.medium(state.content, fontSize: 14);
|
||||
if (state.enableEdit) {
|
||||
child = TextField(
|
||||
controller: _controller,
|
||||
focusNode: focusNode,
|
||||
onChanged: (value) => focusChanged(),
|
||||
onEditingComplete: () => focusNode.unfocus(),
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'Mulish',
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
// Magic number 4 makes the textField take up the same space as FlowyText
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 4),
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
child = FlowyText.medium(state.content, fontSize: 14);
|
||||
child = Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
return Align(alignment: Alignment.centerLeft, child: child);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
@ -100,20 +100,11 @@ class _BoardCardState extends State<BoardCard> {
|
||||
);
|
||||
rowNotifier.insertCell(cellId, cellNotifier);
|
||||
|
||||
if (index != 0) {
|
||||
child = Padding(
|
||||
key: cellId.key(),
|
||||
padding: const EdgeInsets.only(left: 4, right: 4, top: 8),
|
||||
child: child,
|
||||
);
|
||||
} else {
|
||||
child = Padding(
|
||||
key: UniqueKey(),
|
||||
padding: const EdgeInsets.only(left: 4, right: 4),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
child = Padding(
|
||||
key: cellId.key(),
|
||||
padding: const EdgeInsets.only(left: 4, right: 4),
|
||||
child: child,
|
||||
);
|
||||
children.add(child);
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user