我有一個小部件,我有一個下拉串列,具體取決于地圖中的資料量。但問題是這些下拉選單看起來非常接近,是否可以添加它們之間的距離?Список дропдаун?в вмене знадоиться в зм?нн?й “串列”。
Widget _buildAdditionFields(SimpleOrderStates state) {
if (state.isAdditionsProgress) {
return const Padding(
padding: EdgeInsets.all(Margins.small),
child: PlatformProgressIndicator(),
);
} else {
var containsVariants = state.additionEntity?.hasVariants ?? false;
var name = state.additionEntity?.name ?? '';
var options = state.additionEntity
?.getAddition(0)
?.dropdownItems;
print(state.additionEntity?.selectedVariants);
var list = state.additionEntity?.selectedVariants
.mapIndexed(
(index, addition) =>
_buildDropdownField(
text: '',
enabled: true,
progress: false,
dropdownOptions: [],
focusNode: FocusNode(),
applySelected: true,
action: SvgPicture.asset(Img.dropdownArrow),
labelText: addition!["additionName"],
dropdownItemSelected: (item) {
BlocProvider.of<SimpleOrderBloc>(context).add(
SimpleOrderDropdownMenuAdditionItemSelectedEvent(item));
},
textChanged: (text) {}
),
).toList();
if(state.next != null){
list?.add(_buildDropdownField(
text: '',
enabled: true,
progress: false,
dropdownOptions:options ?? [],
focusNode: FocusNode(),
applySelected: true,
action: SvgPicture.asset(Img.dropdownArrow),
labelText: name,
dropdownItemSelected: (item) {
BlocProvider.of<SimpleOrderBloc>(context).add(
SimpleOrderDropdownMenuAdditionItemSelectedEvent(item));
},
textChanged: (text) {}
),);
}
return Column(
children: list ?? [],
);
}
uj5u.com熱心網友回復:
用填充包裹你的下拉小部件。在您的情況下,您需要
填充:EdgeInsets.symmetric(4)
list?.add(
Container(
padding: EdgeInsets.symmetric(vertical: 8),
child: _buildDropdownField(
text: '',
enabled: true,
progress: false,
dropdownOptions:options ?? [],
focusNode: FocusNode(),
applySelected: true,
action: SvgPicture.asset(Img.dropdownArrow),
labelText: name,
dropdownItemSelected: (item) {
BlocProvider.of<SimpleOrderBloc>(context).add(
SimpleOrderDropdownMenuAdditionItemSelectedEvent(item));
},
textChanged: (text) {})));
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/495056.html
