Skip to content

Commit a1dc6bf

Browse files
committed
fix: align student slot view to top left
1 parent d8f7514 commit a1dc6bf

2 files changed

Lines changed: 54 additions & 50 deletions

File tree

lib/src/slots/presentation/screens/slot_reservation_screen.dart

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,56 +27,60 @@ class SlotReservationScreen extends StatelessWidget with AdaptiveWidget {
2727

2828
return Padding(
2929
padding: PaddingTop(),
30-
child: SingleChildScrollView(
31-
child: Column(
32-
spacing: Spacing.largeSpacing,
33-
children: [
34-
for (final group in groups.entries)
35-
Column(
36-
crossAxisAlignment: CrossAxisAlignment.start,
37-
children: [
38-
Padding(
39-
padding: PaddingLeft(),
40-
child: Text(
41-
'${group.key.translate(context)} ${formatter.format(group.key.nextDate)}',
42-
style: context.theme.textTheme.titleMedium,
43-
).bold(),
44-
),
45-
Spacing.smallVertical(),
46-
for (final timespan in group.value.entries)
47-
Column(
48-
children: [
49-
Padding(
50-
padding: PaddingLeft(),
51-
child: Row(
52-
children: [
53-
const Icon(Icons.access_time, size: 16),
54-
Spacing.xsHorizontal(),
55-
Text('${timespan.key.$1.humanReadable()} - ${timespan.key.$2.humanReadable()}'),
56-
],
30+
child: Align(
31+
alignment: Alignment.topLeft,
32+
child: SingleChildScrollView(
33+
child: Column(
34+
spacing: Spacing.largeSpacing,
35+
children: [
36+
for (final group in groups.entries)
37+
Column(
38+
mainAxisAlignment: MainAxisAlignment.start,
39+
crossAxisAlignment: CrossAxisAlignment.start,
40+
children: [
41+
Padding(
42+
padding: PaddingLeft(),
43+
child: Text(
44+
'${group.key.translate(context)} ${formatter.format(group.key.nextDate)}',
45+
style: context.theme.textTheme.titleMedium,
46+
).bold(),
47+
),
48+
Spacing.smallVertical(),
49+
for (final timespan in group.value.entries)
50+
Column(
51+
children: [
52+
Padding(
53+
padding: PaddingLeft(),
54+
child: Row(
55+
children: [
56+
const Icon(Icons.access_time, size: 16),
57+
Spacing.xsHorizontal(),
58+
Text('${timespan.key.$1.humanReadable()} - ${timespan.key.$2.humanReadable()}'),
59+
],
60+
),
5761
),
58-
),
59-
Spacing.smallVertical(),
60-
Padding(
61-
padding: PaddingLeft(),
62-
child: Wrap(
63-
spacing: Spacing.mediumSpacing,
64-
runSpacing: Spacing.mediumSpacing,
65-
children: [
66-
for (final slot in timespan.value)
67-
SizedBox(
68-
key: ValueKey(slot),
69-
width: 300,
70-
child: SlotWidget(slot: slot, date: group.key.nextDate),
71-
),
72-
],
73-
).stretch(),
74-
),
75-
],
76-
).paddingOnly(bottom: Spacing.largeSpacing),
77-
],
78-
),
79-
],
62+
Spacing.smallVertical(),
63+
Padding(
64+
padding: PaddingLeft(),
65+
child: Wrap(
66+
spacing: Spacing.mediumSpacing,
67+
runSpacing: Spacing.mediumSpacing,
68+
children: [
69+
for (final slot in timespan.value)
70+
SizedBox(
71+
key: ValueKey(slot),
72+
width: 300,
73+
child: SlotWidget(slot: slot, date: group.key.nextDate),
74+
),
75+
],
76+
).stretch(),
77+
),
78+
],
79+
).paddingOnly(bottom: Spacing.largeSpacing),
80+
],
81+
),
82+
],
83+
),
8084
),
8185
),
8286
);

lib/src/slots/presentation/widgets/edit_slot_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class _EditSlotDialogState extends State<EditSlotDialog> {
6464
end = widget.slot?.endUnit;
6565

6666
supervisors = List.of(widget.slot?.supervisors ?? []);
67-
size = widget.slot?.size ?? 18; //TODO(mastermarcohd): request default size from backend;
67+
size = widget.slot?.size ?? 18; // TODO(mastermarcohd): request default size from backend;
6868
mappings = List.of(widget.slot?.mappings ?? []);
6969
courseMappings = mappings.map((m) => MappingElement(mappingId: m.id, courseId: m.courseId, vintage: m.vintage)).toList();
7070
if (courseMappings.isEmpty) courseMappings.add(MappingElement());

0 commit comments

Comments
 (0)