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:
@ -331,7 +331,12 @@ class _FieldDetailsEditorState extends State<FieldDetailsEditor> {
|
|||||||
const VSpace(8.0),
|
const VSpace(8.0),
|
||||||
SwitchFieldButton(popoverMutex: popoverMutex),
|
SwitchFieldButton(popoverMutex: popoverMutex),
|
||||||
const TypeOptionSeparator(spacing: 8.0),
|
const TypeOptionSeparator(spacing: 8.0),
|
||||||
FieldTypeOptionEditor(viewId: widget.viewId, popoverMutex: popoverMutex),
|
Flexible(
|
||||||
|
child: FieldTypeOptionEditor(
|
||||||
|
viewId: widget.viewId,
|
||||||
|
popoverMutex: popoverMutex,
|
||||||
|
),
|
||||||
|
),
|
||||||
_addFieldVisibilityToggleButton(),
|
_addFieldVisibilityToggleButton(),
|
||||||
_addDuplicateFieldButton(),
|
_addDuplicateFieldButton(),
|
||||||
_addDeleteFieldButton(),
|
_addDeleteFieldButton(),
|
||||||
@ -437,7 +442,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
typeOptionEditor,
|
Flexible(child: typeOptionEditor),
|
||||||
const TypeOptionSeparator(spacing: 8.0),
|
const TypeOptionSeparator(spacing: 8.0),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -45,11 +45,16 @@ class SelectOptionTypeOptionWidget extends StatelessWidget {
|
|||||||
] else
|
] else
|
||||||
const _AddOptionButton(),
|
const _AddOptionButton(),
|
||||||
const VSpace(4),
|
const VSpace(4),
|
||||||
_OptionList(popoverMutex: popoverMutex),
|
...state.options.map((option) {
|
||||||
|
return _OptionCell(
|
||||||
|
option: option,
|
||||||
|
popoverMutex: popoverMutex,
|
||||||
|
);
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Column(
|
return ListView(
|
||||||
mainAxisSize: MainAxisSize.min,
|
shrinkWrap: true,
|
||||||
children: children,
|
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 {
|
class _OptionCell extends StatefulWidget {
|
||||||
final SelectOptionPB option;
|
final SelectOptionPB option;
|
||||||
final PopoverMutex? popoverMutex;
|
final PopoverMutex? popoverMutex;
|
||||||
|
Reference in New Issue
Block a user