title: How to get the selected item value from DropDownMenu
body: <p>i'm new in flutter, i create my widget GenreDropDown, that shows the various genres of films; i used it in MyHomePage and i would show the selected item in a widget Text (just test), but i don't know how to get the selected item in the MyHomePage screen, i need it because later i would add others widgets TextField and send all data via a FlatButton (like a form)</p>
  
  <p>This is MyHomePage</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:appcinema/Model/Genre.dart';
  
  class MyHomePage extends StatefulWidget {
  
    static const routeName = '/';
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        appBar: AppBar(
          title: Text("App Cinema"),
        ),
        body: SafeArea(
          child: Padding(
            padding: EdgeInsets.all(10),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: &lt;Widget&gt;[
                Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: &lt;Widget&gt;[
                    Text("Select the genre of the film: ", style: TextStyle(fontSize: 17)),
                    GenreDropDown(),
  
                  ],
                ),
                //Text where i would show the selected value of GenreDropDown
              ],
            ),
          ),
        )
      );
    }
  }
  </code></pre>
  
  <p>This is the class Genre and GenreDropDown</p>
  
  <pre><code>import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  
  class Genre{
    final int id;
    final String name;
  
    Genre(this.id, this.name);
  
  }
  
  class GenreDropDown extends StatefulWidget {
  
    @override
    GenreDropDownWidget createState() =&gt; GenreDropDownWidget();
  }
  
  class GenreDropDownWidget extends State&lt;GenreDropDown&gt;{
  
    Genre ddbValue;
  
    final List&lt;Genre&gt; genreList = &lt;Genre&gt;[
      Genre(1, "Animation"),
      Genre(2, "Action"),
      Genre(3, "Adventure"),
      Genre(4, "Biography"),
      Genre(5, "Comedy"),
      Genre(6, "Crime"),
      Genre(7, "Documentary"),
      Genre(8, "Drama"),
      Genre(9, "Erotic"),
      Genre(10, "Family"),
      Genre(11, "Fantasy"),
      Genre(12, "Horror"),
      Genre(13, "History"),
      Genre(14, "Musical"),
      Genre(15, "Mystery"),
      Genre(16, "Philosophical"),
      Genre(17, "Political"),
      Genre(18, "Romance"),
      Genre(19, "Science Fiction"),
      Genre(20, "Sci-Fi"),
      Genre(21, "Social"),
      Genre(22, "Thriller"),
      Genre(23, "Urban"),
      Genre(24, "War"),
      Genre(25, "Western")
    ];
  
    @override
    Widget build(BuildContext context) {
      return Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: &lt;Widget&gt;[
          DropdownButton&lt;Genre&gt;(
            disabledHint: Text("Disabilitated"),
            hint: Text("ex: Fantasy"),
            isExpanded: false,
            value: ddbValue,
            items: genreList.map&lt;DropdownMenuItem&lt;Genre&gt;&gt;(
                    (Genre item){
                  return DropdownMenuItem&lt;Genre&gt;(
                    value: item,
                    child: Text(item.name),
                  );
                }
            ).toList(),
            onChanged: (Genre newValue){
              setState(() {
                ddbValue = newValue;
              });
            },
          ),
        ],
      );
    }
  }
  </code></pre>