Answers for "find the index of a selected item in flutter web"

0

find the index of a selected item in flutter web

getDropDownMenuItems(snapshot) {
    Map<int, dynamic> mapWithIndex = snapshot.data.services.asMap;
    List<DropdownMenuItem> _items = [];
    mapWithIndex.forEach((index, item) {
      _items.add(
        DropdownMenuItem<int>(
          value: index,
          child: Text(item.service),
        ),
      );
    });
    return _items;
  }
Posted by: Guest on July-13-2021

Code answers related to "find the index of a selected item in flutter web"

Browse Popular Code Answers by Language