Flutter picker view ,Set state not working
set State not working in picker
final dropdownDesignation = MaterialButton(
child: Text(
selectedDesignation,
style: style,
),
height: 50,
elevation: 0,
color: appBackgroundColor,
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext builder) {
return Container(
child: ListView.builder(
itemCount: litems.length,
itemBuilder:(BuildContext context,int index){
return ListTile(onTap: ()async {
setState(() {
selectedDesignation = litems[index];
});
},title:Column(crossAxisAlignment: CrossAxisAlignment.start,children: <Widget>[
Text(litems[index]),
],)
);
} ),
height: MediaQuery.of(context).copyWith().size.height / 3,
);
});
},
);