mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: select field type option editor overflow (#4188)
This commit is contained in:
parent
13260e1db8
commit
0730a0caf4
@ -331,7 +331,12 @@ class _FieldDetailsEditorState extends State<FieldDetailsEditor> {
|
||||
const VSpace(8.0),
|
||||
SwitchFieldButton(popoverMutex: popoverMutex),
|
||||
const TypeOptionSeparator(spacing: 8.0),
|
||||
FieldTypeOptionEditor(viewId: widget.viewId, popoverMutex: popoverMutex),
|
||||
Flexible(
|
||||
child: FieldTypeOptionEditor(
|
||||
viewId: widget.viewId,
|
||||
popoverMutex: popoverMutex,
|
||||
),
|
||||
),
|
||||
_addFieldVisibilityToggleButton(),
|
||||
_addDuplicateFieldButton(),
|
||||
_addDeleteFieldButton(),
|
||||
@ -437,7 +442,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
typeOptionEditor,
|
||||
Flexible(child: typeOptionEditor),
|
||||
const TypeOptionSeparator(spacing: 8.0),
|
||||
],
|
||||
);
|
||||
|
@ -45,11 +45,16 @@ class SelectOptionTypeOptionWidget extends StatelessWidget {
|
||||
] else
|
||||
const _AddOptionButton(),
|
||||
const VSpace(4),
|
||||
_OptionList(popoverMutex: popoverMutex),
|
||||
...state.options.map((option) {
|
||||
return _OptionCell(
|
||||
option: option,
|
||||
popoverMutex: popoverMutex,
|
||||
);
|
||||
}),
|
||||
];
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
return ListView(
|
||||
shrinkWrap: true,
|
||||
children: children,
|
||||
);
|
||||
},
|
||||
@ -81,39 +86,6 @@ class _OptionTitle extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _OptionList extends StatelessWidget {
|
||||
final PopoverMutex? popoverMutex;
|
||||
const _OptionList({this.popoverMutex});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<SelectOptionTypeOptionBloc, SelectOptionTypeOptionState>(
|
||||
buildWhen: (previous, current) {
|
||||
return previous.options != current.options;
|
||||
},
|
||||
builder: (context, state) {
|
||||
final cells = state.options.map((option) {
|
||||
return _OptionCell(
|
||||
option: option,
|
||||
popoverMutex: popoverMutex,
|
||||
);
|
||||
}).toList();
|
||||
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (context, index) {
|
||||
return VSpace(GridSize.typeOptionSeparatorHeight);
|
||||
},
|
||||
itemCount: cells.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return cells[index];
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _OptionCell extends StatefulWidget {
|
||||
final SelectOptionPB option;
|
||||
final PopoverMutex? popoverMutex;
|
||||
|
Loading…
Reference in New Issue
Block a user