Skip to content
Snippets Groups Projects
Commit dfe65308 authored by doodlezucc's avatar doodlezucc
Browse files

introduce drawer header

parent c2851879
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,18 @@ class _ClassDrawerState extends State<ClassDrawer> {
late final searchTextController = TextEditingController(text: activeQuery);
List<Class> get availableClasses => widget.appContext.classes ?? [];
Set<Class> get selectedClasses =>
widget.appContext.profile.value!.selectedClasses
.map((id) => availableClasses.firstWhere((cls) => cls.id == id))
.toSet();
String get headerText {
final classes = selectedClasses;
final selectedNames =
classes.map((cls) => cls.codeWithoutFaculty).join(', ');
return selectedNames;
}
@override
void initState() {
......@@ -109,13 +121,26 @@ class _ClassDrawerState extends State<ClassDrawer> {
return Drawer(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: searchTextController,
decoration: const InputDecoration(
hintText: 'Suche...',
),
DrawerHeader(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
headerText,
style: TextStyle(
// fontWeight: FontWeight.bold,
color: Theme.of(context).primaryColor,
),
),
Expanded(child: Container()),
TextField(
controller: searchTextController,
decoration: const InputDecoration(
hintText: 'Suche...',
),
),
],
),
),
Expanded(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment