Вы можете использовать расширяемый пакет.
Я пытался создать то, что вы хотите, основываясь на вашем json.
class Student {
final String discipline;
final String semester;
final String section;
final String name;
Student({this.discipline, this.semester, this.section, this.name});
}
Затем, на вашем методе сборки
List<Student> _studentGroup = <Student>[
Student(discipline: 'BCS', semester: '7', section: 'B', name: 'Test Name'),
Student(discipline: 'BCS', semester: '7', section: 'B', name: 'Test Name2'),
Student(discipline: 'BCS', semester: '7', section: 'B', name: 'Test Name3'),
];
@override
Widget build(BuildContext context) {
return Scaffold(
//appbar
body: Container(
width: double.infinity,
child: ExpandablePanel(
header: Text(
'${_studentGroup[0].discipline} ${_studentGroup[0].semester} ${_studentGroup[0].section}'),
expanded: ListView.builder(
shrinkWrap: true,
itemCount: _studentGroup == null ? 0 : _studentGroup.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Text(_studentGroup[index].name),
subtitle: Text(
'${_studentGroup[index].discipline} - ${_studentGroup[index].semester}',
));
},
),
),
));
}