make method

  1. @override
StatefulBuilder make({
  1. Key? key,
})

Implementation

@override
StatefulBuilder make({Key? key}) {
  return StatefulBuilder(
    builder: (BuildContext context, StateSetter setState) {
      return DropdownButton<String>(
        key: key,
        value: selectedValue,
        style: _textStyle,
        underline: _underLine,
        iconEnabledColor: _enabledIconColor,
        iconDisabledColor: _disabledIconColor,
        elevation: _elevation ?? 8,
        iconSize: _iconSize ?? 24,
        icon: _dropDownIcon,
        autofocus: _autoFocus,
        isExpanded: _isExpanded,
        focusColor: _focusColor,
        isDense: _isDense,
        items: _items
            .map<DropdownMenuItem<String>>((item) => DropdownMenuItem<String>(
                  value: item,
                  child: item.text.make(),
                ))
            .toList(),
        onChanged: (String? value) {
          setState(() {
            selectedValue = value;
          });
          onChanged(value);
        },
      );
    },
  );
}