Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- informaResultado(List<int> resposta, double questao3) {
- int soma = resposta.elementAt(0)+
- resposta.elementAt(1)+
- resposta.elementAt(5)+
- resposta.elementAt(6);
- if(soma==4){
- if (questao3 < 50) {
- return 2;
- } else if (questao3 > 50 && questao3 < 100) {
- return 3;
- } else if (questao3 > 100) {
- return 1;
- }
- } else if (soma == 0) {
- if (questao3 < 40) {
- return 2;
- }else if (questao3 < 100) {
- return 3;
- } else
- return 1;
- }else if(questao3==0)
- return 4;
- return 4;
- }
- List _escolaridade = ["fundamental incompleto","fundamental completo", "médio completo", "medico incompleto", "superior completo", "superior incompleto","pós-graduação"];
- List resposta = new List();
- List<DropdownMenuItem<String>> _dropDownMenuItems;
- String _nivelEscolaridade;
- void initState() {
- _dropDownMenuItems = buildAndGetDropDownMenuItems(_escolaridade);
- _nivelEscolaridade = _dropDownMenuItems[0].value;
- super.initState();
- }
- List<DropdownMenuItem<String>> buildAndGetDropDownMenuItems(List _escolaridade) {
- List<DropdownMenuItem<String>> items = new List();
- for (String nivel in _escolaridade) {
- items.add(new DropdownMenuItem(value: nivel, child: new Text(nivel)));
- }
- return items;
- }
- void changedDropDownItem(String escolaridade) {
- setState(() {
- _nivelEscolaridade = escolaridade;
- });
- }
- @override
- Widget build(BuildContext context) {
- return Container(
- child: new Column(children: <Widget>[
- new Text("Please choose a fruit: "),
- new DropdownButton(
- value: _nivelEscolaridade,
- items: _dropDownMenuItems,
- onChanged: changedDropDownItem,
- )
- ],)
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement