title: DropdownMenuItem how to get string data of the Text widget
body: <pre><code>List&lt;DropdownMenuItem&lt;String&gt;&gt; department = [];
  
  @override
  void initState() {
    super.initState();
    department.add(DropdownMenuItem(
      value: 'DEP0000001',
      child: Text('IT - SAP'),
    ));
    department.add(DropdownMenuItem(
      value: 'DEP0000002',
      child: Text('HR - Admin'),
    ));
    department.add(DropdownMenuItem(
      value: 'DEP0000003',
      child: Text('Engineering'),
    ));
  }
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: &lt;Widget&gt;[
          DropdownButton(
            items: department,
            onChanged: (value) {
              setState(() {
                _deptCode = value;
              });
            },
            hint: Text('Select Department'),
            value: _deptCode,
          ),
        ],
      ),
    );
  }
  </code></pre>
  
  <p>In here I can get the value of the department code. However, I want also to get the department name. I was trying to get the String data Text widget but I think it's not possible. Is there any approach?</p>