I have 2 dropdown buttons, which one have a list with an 'id' and a 'name' and i need to make like when i choose a option from one dropdown button only appear a certain number of options in the second dropdown button. In the image 4 if i choose a option in the first dropdown button it would show only like 4 options in the second dropdown button(image 5). im kinda new to this, idk if this is to much to ask. sorry.
DropdownButton<DisciplinaResumo>(
value: selectedDisciplina,
onChanged: (DisciplinaResumo? newValue) {
setState(
() {
selectedDisciplina = newValue!;
disciplinaController.text = selectedDisciplina.toString();
},
);
},
items: disciplinaResumo.map(
(DisciplinaResumo resumo) {
return new DropdownMenuItem<DisciplinaResumo>(
value: resumo,
child: new Text(
resumo.name,
style: Theme.of(context).textTheme.headline5,
),
);
},
).toList(),
),
DropdownButton<ModuloResumo>(
value: selectedModulo,
onChanged: (ModuloResumo? newValue) {
setState(
() {
selectedModulo = newValue!;
moduloController.text = selectedModulo.toString();
},
);
},