반응형
머티리얼 디자인 버튼입니다.
class _MyHomePageState extends State<MyHomePage> {
final _valueList = ['내것', '여기', '저기'];
var _selectedValue;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("DropDownButton"),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: DropdownButton(
hint: Text('선택해주세요'),
value: _selectedValue,
items: _valueList.map((value) {
return DropdownMenuItem(value: value, child: Text(value));
}).toList(),
onChanged: (value) {
print(value);
setState(() {
_selectedValue = value;
});
}),
),
));
}
}
'flutter.widget' 카테고리의 다른 글
image (0) | 2020.11.30 |
---|---|
WebView (0) | 2020.11.17 |
Builder (0) | 2019.11.27 |
[내용추가 필요]PageView (0) | 2019.11.25 |
ValueListenableBuilder<T> (0) | 2019.11.22 |