Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. informaResultado(List<int> resposta, double questao3) {
  2. int soma = resposta.elementAt(0)+
  3. resposta.elementAt(1)+
  4. resposta.elementAt(5)+
  5. resposta.elementAt(6);
  6.  
  7.  
  8.  
  9. if(soma==4){
  10. if (questao3 < 50) {
  11. return 2;
  12. } else if (questao3 > 50 && questao3 < 100) {
  13. return 3;
  14. } else if (questao3 > 100) {
  15. return 1;
  16. }
  17. } else if (soma == 0) {
  18. if (questao3 < 40) {
  19. return 2;
  20. }else if (questao3 < 100) {
  21. return 3;
  22. } else
  23. return 1;
  24.  
  25. }else if(questao3==0)
  26. return 4;
  27.  
  28. return 4;
  29. }
  30.  
  31.  
  32.  
  33.  
  34. List _escolaridade = ["fundamental incompleto","fundamental completo", "médio completo", "medico incompleto", "superior completo", "superior incompleto","pós-graduação"];
  35.  
  36. List resposta = new List();
  37.  
  38.  
  39. List<DropdownMenuItem<String>> _dropDownMenuItems;
  40. String _nivelEscolaridade;
  41.  
  42. void initState() {
  43. _dropDownMenuItems = buildAndGetDropDownMenuItems(_escolaridade);
  44. _nivelEscolaridade = _dropDownMenuItems[0].value;
  45. super.initState();
  46. }
  47.  
  48. List<DropdownMenuItem<String>> buildAndGetDropDownMenuItems(List _escolaridade) {
  49. List<DropdownMenuItem<String>> items = new List();
  50. for (String nivel in _escolaridade) {
  51. items.add(new DropdownMenuItem(value: nivel, child: new Text(nivel)));
  52. }
  53. return items;
  54. }
  55.  
  56. void changedDropDownItem(String escolaridade) {
  57. setState(() {
  58. _nivelEscolaridade = escolaridade;
  59. });
  60. }
  61.  
  62.  
  63. @override
  64. Widget build(BuildContext context) {
  65. return Container(
  66. child: new Column(children: <Widget>[
  67. new Text("Please choose a fruit: "),
  68. new DropdownButton(
  69. value: _nivelEscolaridade,
  70. items: _dropDownMenuItems,
  71. onChanged: changedDropDownItem,
  72. )
  73.  
  74.  
  75.  
  76.  
  77. ],)
  78.  
  79. );
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement