admin管理员组文章数量:1026989
How can I increase the height of the closed dropdown text area in Flutter (highlighted in red in the image)? I tried increasing the contentPadding
vertical value to 40, but it only increases the overall height of the dropdown box, not just the text area. I also attempted to set the height in style
and hint
, but nothing seems to work to adjust the visible text area of the closed dropdown.
DropdownButtonFormField<ParkingModel>(
isExpanded: true,
decoration: InputDecoration(
errorStyle: const TextStyle(color: Colors.red),
isDense: false,
filled: true,
fillColor: themeChange.getThem() ? AppThemData.grey10 : AppThemData.grey03,
contentPadding: const EdgeInsets.symmetric(vertical: 40, horizontal: 10),
prefixIcon: Padding(
padding: const EdgeInsets.all(1.0),
child: SvgPicture.asset("assets/icon/ic_car_image.svg", height: 24, width: 24),
),
disabledBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
focusedBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.primary06 : AppThemData.primary06, width: 1),
),
enabledBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
errorBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
border: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
hintStyle: TextStyle(
fontSize: 14,
color: themeChange.getThem() ? AppThemData.grey06 : AppThemData.grey06,
fontWeight: FontWeight.w500,
fontFamily: AppThemData.medium),
),
value: controller.selectedParkingModel.value.id == null ? null : controller.selectedParkingModel.value,
onChanged: (value) {
controller.selectedParkingModel.value = value!;
controller.update();
},
style: TextStyle(
fontSize: 14,
color: themeChange.getThem() ? AppThemData.grey02 : AppThemData.grey08,
fontWeight: FontWeight.w500,
fontFamily: AppThemData.medium),
hint: Text(
"Select Your Parking".tr,
style: TextStyle(color: themeChange.getThem() ? AppThemData.grey07 : AppThemData.grey07),
),
items: controller.parkingList.map((item) {
return DropdownMenuItem<ParkingModel>(
value: item,
child: Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
padding: EdgeInsets.fromLTRB(0, 0, 0, 3),
child: Text(item.name.toString(), style: const TextStyle(
fontSize: 14,
))),
);
}).toList()),
Image_
the text is displaying in the closed dropdown
How can I increase the height of the closed dropdown text area in Flutter (highlighted in red in the image)? I tried increasing the contentPadding
vertical value to 40, but it only increases the overall height of the dropdown box, not just the text area. I also attempted to set the height in style
and hint
, but nothing seems to work to adjust the visible text area of the closed dropdown.
DropdownButtonFormField<ParkingModel>(
isExpanded: true,
decoration: InputDecoration(
errorStyle: const TextStyle(color: Colors.red),
isDense: false,
filled: true,
fillColor: themeChange.getThem() ? AppThemData.grey10 : AppThemData.grey03,
contentPadding: const EdgeInsets.symmetric(vertical: 40, horizontal: 10),
prefixIcon: Padding(
padding: const EdgeInsets.all(1.0),
child: SvgPicture.asset("assets/icon/ic_car_image.svg", height: 24, width: 24),
),
disabledBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
focusedBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.primary06 : AppThemData.primary06, width: 1),
),
enabledBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
errorBorder: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
border: UnderlineInputBorder(
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
borderSide: BorderSide(color: themeChange.getThem() ? AppThemData.grey09 : AppThemData.grey04, width: 1),
),
hintStyle: TextStyle(
fontSize: 14,
color: themeChange.getThem() ? AppThemData.grey06 : AppThemData.grey06,
fontWeight: FontWeight.w500,
fontFamily: AppThemData.medium),
),
value: controller.selectedParkingModel.value.id == null ? null : controller.selectedParkingModel.value,
onChanged: (value) {
controller.selectedParkingModel.value = value!;
controller.update();
},
style: TextStyle(
fontSize: 14,
color: themeChange.getThem() ? AppThemData.grey02 : AppThemData.grey08,
fontWeight: FontWeight.w500,
fontFamily: AppThemData.medium),
hint: Text(
"Select Your Parking".tr,
style: TextStyle(color: themeChange.getThem() ? AppThemData.grey07 : AppThemData.grey07),
),
items: controller.parkingList.map((item) {
return DropdownMenuItem<ParkingModel>(
value: item,
child: Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
padding: EdgeInsets.fromLTRB(0, 0, 0, 3),
child: Text(item.name.toString(), style: const TextStyle(
fontSize: 14,
))),
);
}).toList()),
Image_
the text is displaying in the closed dropdown
本文标签: dartDropDown in flutterStack Overflow
版权声明:本文标题:dart - DropDown in flutter - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745658689a2161755.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论