The DropdownButton comes with DropdownMenuItem. This widget needs to be included value and child, in addition, this dropdownbutton has attribute, items, array list, so we can pass map function values but it's required to be added with toList() method.
dispose like initState and build is part of a stateful widget's lifecycle. It's called automatically by Flutter when the widget & its state are about to be destroyed.
dispose method used to release the memory allocated to variables when state object is removed.