I watched the official DropDownButton example and the background is always gray when pressed for a long time, how can I change it?
When the DropdownButton
is on focused, it uses focusColor
. For the long press it uses the splashColor
. Yo can wrap with Theme and provide splashColor.
Theme(
data: ThemeData(
splashColor: Colors.green,
),
child: DropdownButton<String>(
dropdownColor: Colors.pink, // main bg
focusColor: Colors.amber,// when focused
value: dropdownValue,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.