getDropDownDecor<T> static method

InputDecorator getDropDownDecor<T>(
  1. String hints,
  2. dynamic vatList,
  3. dynamic selectedVat,
  4. void callback(
    1. dynamic
    ),
)

Implementation

static InputDecorator getDropDownDecor<T>(String hints, dynamic vatList,
    dynamic selectedVat, void Function(dynamic) callback) {
  var widget = InputDecorator(
    decoration: SimpleWidget.getDropDownDecoration(hints),
    child: DropdownButtonHideUnderline(
      child: ButtonTheme(
        alignedDropdown: true,
        child: DropdownButton<T>(
          isDense: true,
          icon: const Icon(Icons.keyboard_arrow_down),
          value: selectedVat,
          onChanged: callback,
          items: vatList.map<DropdownMenuItem<T>>((items) {
            return DropdownMenuItem<T>(
              value: items,
              child: Row(
                children: [
                  Padding(
                    padding: const EdgeInsets.only(top: 7),
                    child: Text(items.name!),
                  ),
                ],
              ),
            );
          }).toList(),
        ),
      ),
    ),
  );

  return widget;
}