英文:
Flutter button hint text not showing
问题
我正在使用multi_select_flutter包,它显示的下拉框比原生的flutter选项更好。然而,提示文本没有显示 - 昨天还显示,然后突然消失了,我不确定为什么会发生这种情况。有其他人遇到相同的问题吗?以下是我的代码:
MultiSelectBottomSheetField(
initialChildSize: 0.4,
listType: MultiSelectListType.CHIP,
searchable: true,
selectedColor: Color.fromARGB(255, 31, 31, 31),
searchHint: 'Biceps',
confirmText: Text('SAVE', style: TextStyle(color: Colors.black)),
selectedItemsTextStyle: TextStyle(color: Colors.white),
buttonText: Text("Muscles used",
style: TextStyle(
fontSize: 30,
color: Color.fromARGB(255, 255, 255, 255),
)),
buttonIcon: Icon(Icons.arrow_downward, color: Colors.white),
barrierColor: Color.fromARGB(255, 43, 43, 43).withOpacity(.7),
title: Text("Muscles (Scroll down for more)"),
items: _options,
onConfirm: (values) {
selectedOptions = values;
},
initialValue: selectedOptions,
chipDisplay: MultiSelectChipDisplay(
onTap: (value) {
setState(() {
selectedOptions.remove(value);
});
},
),
)
非常感谢!
英文:
I am using the package multi_select_flutter, that displays a dropdown better than the native flutter option. However, the hint text is not showing - it was showing up until yesterday, and then disappeared, and I am not sure why this is happening. Did anyone else have the same issue? Here is my code
MultiSelectBottomSheetField(
initialChildSize: 0.4,
listType: MultiSelectListType.CHIP,
searchable: true,
selectedColor: Color.fromARGB(255, 31, 31, 31),
searchHint: 'Biceps',
confirmText:
Text('SAVE', style: TextStyle(color: Colors.black)),
selectedItemsTextStyle: TextStyle(color: Colors.white),
buttonText: Text("Muscles used",
style: TextStyle(
fontSize: 30,
color: Color.fromARGB(255, 255, 255, 255),
)),
buttonIcon:
Icon(Icons.arrow_downward, color: Colors.white),
barrierColor:
Color.fromARGB(255, 43, 43, 43).withOpacity(.7),
title: Text("Muscles (Scroll down for more)"),
items: _options,
onConfirm: (values) {
selectedOptions = values;
},
initialValue: selectedOptions,
chipDisplay: MultiSelectChipDisplay(
onTap: (value) {
setState(() {
selectedOptions.remove(value);
});
},
),
),
THANK YOU SO MUCH!!!
答案1
得分: 1
我检查了你的代码,发现在MultiSelectBottomSheetField中存在一个bug,当你为buttonText定义了textStyle时,它不会显示出来,然而,你需要移除为buttonText定义的textStyle,它就会显示出来。
英文:
I checked your code and there is a bug in MultiSelectBottomSheetField, when you define textStyle for buttonText it doesn't show it, however, you needs to remove textStyle that you have defined for buttonText and it will show it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论