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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745658691a4638701.html
评论列表(0条)