Suppose there is 2 item in my DropdownList. If user choose 1st item initially , next time only 2nd item should available to select( i.e.1st item non-clickable).
child: DropdownButton<Datum>(
enabled= enabled_Item,
value: _selectedTest,
hint: Text(""),
//underline: SizedBox(),
isExpanded: true,
items: data
.map(
(Datum data) => DropdownMenuItem<Datum>(
child: Text("${data.testName}"),
enabled: data.testId != _selectedTest,
value: data,
))
.toList()
.cast<DropdownMenuItem<Datum>>(),
onChanged: (value) {
print(
"This is the TestName : ${value!.testName}");
print(
"This is the EncTestId which is need to get Test Fee : ${value.testId}");
setState(() {
encTestId = value.testId; // == SELCTED TEST from drop down 'encTestId' needed for to get Test Fee
testName = value.testName;
_selectedTest = value;
});
//GetTestByLab(value!.encPartnerId); // passing encid to my next API function
}),