Flutter Dropdown Button Example

As a part of our flutter tutorial series, we’re going to learn how to implement dropdown button with flutter.


Flutter Dropdown Button Example Source code

class _HomePageState extends State {
  String _selectedItem = 'Sun';
  List _options = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("DropDown Example"),
      body: Container(
        width: double.infinity,
        child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Text("Selected Day: $_selectedItem"),
                value: _selectedItem,
                items: _options
                      (day) => DropdownMenuItem(
                        child: Text(day),
                        value: day,
                onChanged: (value) {
                  setState(() {
                    _selectedItem = value;

Additional Resources