String _status = null;
String _oplachen = null;
String _tip = null;
List<String> _statuses= new List<String>();
List<String> _oplachenes = new List<String>();
List<String> _tips= new List<String>();
//final List<String> _yearsauto = new List<String>();
@override void initState(){
_statuses.addAll({'Водительский стаж','Менее 1 года','более 1 года'});
_oplachenes.addAll({
'Год выпуска автомобиля',
'Год выпуска автомобиля 2',
});
_tips.addAll({
'Год выпуска автомобиля',
'Год выпуска автомобиля 2',
});
_status = _statuses.elementAt(0);
_oplachen = _oplachenes.elementAt(0);
_tip = _tips.elementAt(0);
}
void _onChanged(String value){
setState((){
_status = value;
});
}
void _onChangedopl(String value){
setState((){
_oplachen = value;
});
}
void _onChangetp(String value){
setState((){
_tip = value;
});
}
@override _displayDialog(BuildContext context) async {
return showGeneralDialog(
context: context,
barrierDismissible: true,
barrierLabel: MaterialLocalizations.of(context)
.modalBarrierDismissLabel,
barrierColor: Colors.black45,
transitionDuration: const Duration(milliseconds: 200),
pageBuilder: (BuildContext buildContext,
Animation animation,
Animation secondaryAnimation) {
return Center(
child: Container(
width: MediaQuery.of(context).size.width - 40,
height: MediaQuery.of(context).size.height - 120,
padding: EdgeInsets.all(20),
//margin: EdgeInsets.only(top:120.0),
color: Colors.white,
child: Column(
children: [
Material(
//margin: EdgeInsets.only(left:20.0,right: 20.0, top:20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
width: double.infinity,
child: DropdownButton(
isExpanded: true,
value: _status,
items: _statuses.map((String value){
return
DropdownMenuItem(
value: value,
child:Row(
children: <Widget>[
Text('$value',
style: TextStyle(color: Colors.grey[600]),
),
],)
);
}).toList(),
onChanged: (String value){
_onChanged(value);
},
),
),
],
)
),
SizedBox(height:20,),
Material(
//margin: EdgeInsets.only(left:20.0,right: 20.0, top:20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
width: double.infinity,
child: DropdownButton(
isExpanded: true,
value: _oplachen,
items: _oplachenes.map((String value){
return
DropdownMenuItem(
value: value,
child:Row(
children: <Widget>[
Text('$value',
style: TextStyle(color: Colors.grey[600]),
),
],)
);
}).toList(),