Skip to content

Commit 7d77573

Browse files
wip
1 parent f014c63 commit 7d77573

12 files changed

Lines changed: 207 additions & 165 deletions

File tree

school_data_hub_flutter/lib/app_utils/pupil_identity_file_import.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ class SchildExportColumns {
5151
static const int nationality = 10; // Staatsangehörigkeit (Schlüssel)
5252
static const int migrationBackground = 11; // Migrationshintergrund vorhanden
5353
static const int language = 12; // Verkehrssprache in der Familie
54-
static const int familyLanguageLessonsSince = 13; // Externe ID-Nummer (hijacked)
54+
static const int family = 13; // Externe ID-Nummer (hijacked for family code)
5555
static const int birthday = 14; // Geburtsdatum
5656
static const int migrationSupportEnds = 15; // Ende der Eingliederungsphase
5757
static const int pupilSince = 16; // Aufnahmedatum
5858
static const int afterSchoolCare = 17; // bes. Merkmal (e.g. OFFGANZ = OGS)
5959
static const int religion = 18; // Konfession (Klartext)
6060
static const int religionLessonsSince = 19; // Religionsanmeldung
6161
static const int religionLessonsCancelledAt = 20; // Religionsabmeldung
62-
static const int family = 21; // Ausweisnummer (hijacked for family code)
62+
static const int familyLanguageLessonsSince = 21; // Ausweisnummer (hijacked for familyLanguageLessonsSince)
6363
static const int schoolTransitionRecommendation = 22; // Übergangsempfehlung
6464
static const int leavingDate = 23; // Entlassdatum
6565
}

school_data_hub_flutter/lib/app_utils/scanner.dart

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,49 @@ Future<String?> qrScanner({
4242
controller.dispose();
4343
},
4444
),
45+
//TODO: Style this better
4546
Positioned(
46-
bottom: 50,
47+
bottom: 100,
4748
left: 0,
4849
right: 0,
49-
child: Row(
50-
mainAxisAlignment: MainAxisAlignment.center,
51-
children: [
52-
Text(
53-
overlayText,
54-
textAlign: TextAlign.center,
55-
style: const TextStyle(
56-
decoration: TextDecoration.none,
57-
backgroundColor: Colors.transparent,
58-
fontSize: 20,
59-
fontWeight: FontWeight.bold,
60-
color: Colors.white,
61-
),
50+
child: Padding(
51+
padding: const EdgeInsets.all(16.0),
52+
child: Container(
53+
padding: const EdgeInsets.all(16.0),
54+
decoration: BoxDecoration(
55+
color: Colors.black54,
56+
borderRadius: BorderRadius.circular(8.0),
6257
),
63-
],
58+
child: Row(
59+
mainAxisAlignment: MainAxisAlignment.center,
60+
children: [
61+
Text(
62+
overlayText,
63+
textAlign: TextAlign.center,
64+
style: const TextStyle(
65+
decoration: TextDecoration.none,
66+
backgroundColor: Colors.transparent,
67+
fontSize: 20,
68+
fontWeight: FontWeight.bold,
69+
color: Colors.white,
70+
),
71+
),
72+
],
73+
),
74+
),
75+
),
76+
),
77+
Positioned(
78+
top: 40,
79+
left: 20,
80+
child: IconButton(
81+
color: Colors.red,
82+
83+
onPressed: () {
84+
Navigator.pop(context);
85+
controller.dispose();
86+
},
87+
icon: const Icon(Icons.close, color: Colors.white, size: 30),
6488
),
6589
),
6690
],

school_data_hub_flutter/lib/common/widgets/avatar/avatar.dart

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@ import 'package:flutter_it/flutter_it.dart';
33
import 'package:school_data_hub_client/school_data_hub_client.dart';
44
import 'package:school_data_hub_flutter/common/theme/app_colors.dart';
55
import 'package:school_data_hub_flutter/common/theme/styles.dart';
6+
import 'package:school_data_hub_flutter/common/widgets/avatar/pupil_set_avatar.dart';
67
import 'package:school_data_hub_flutter/common/widgets/dialogs/confirmation_dialog.dart';
78
import 'package:school_data_hub_flutter/common/widgets/dialogs/information_dialog.dart';
89
import 'package:school_data_hub_flutter/common/widgets/get_image_cached_or_download.dart';
9-
import 'package:school_data_hub_flutter/features/attendance/domain/attendance_helper.dart';
10-
import 'package:school_data_hub_flutter/features/attendance/domain/attendance_manager.dart';
1110
import 'package:school_data_hub_flutter/features/_pupil/domain/models/pupil_proxy.dart';
1211
import 'package:school_data_hub_flutter/features/_pupil/domain/pupil_mutator.dart';
1312
import 'package:school_data_hub_flutter/features/_pupil/domain/pupil_proxy_helper.dart';
14-
import 'package:school_data_hub_flutter/common/widgets/avatar/pupil_set_avatar.dart';
13+
import 'package:school_data_hub_flutter/features/attendance/domain/attendance_helper.dart';
14+
import 'package:school_data_hub_flutter/features/attendance/domain/attendance_manager.dart';
1515
import 'package:school_data_hub_flutter/features/schoolday_events/domain/schoolday_event_helper_functions.dart';
1616
import 'package:school_data_hub_flutter/features/schoolday_events/domain/schoolday_event_manager.dart';
1717
import 'package:widget_zoom/widget_zoom.dart';
1818

19+
enum ReligionShortform {
20+
catholic('K'),
21+
islam('I');
22+
23+
final String value;
24+
const ReligionShortform(this.value);
25+
}
26+
1927
class AvatarImage extends WatchingStatefulWidget {
2028
final PupilProxy pupil;
2129
final double size;
@@ -328,42 +336,32 @@ class AvatarWithBadges extends StatelessWidget {
328336
right: -_badgeOffset,
329337
child: Align(
330338
alignment: Alignment.centerRight,
331-
child: Stack(
332-
alignment: Alignment.center,
333-
children: [
334-
Text(
335-
specialNeedsText ??
336-
(pupil.latestSupportLevel != null
337-
? pupil.latestSupportLevel!.level.toString()
338-
: ''),
339-
textAlign: TextAlign.center,
340-
style: TextStyle(
341-
fontWeight: FontWeight.bold,
342-
fontSize: specialNeedsText != null ? 17 : 18,
343-
foreground: Paint()
344-
..style = PaintingStyle.stroke
345-
..strokeWidth = 4
346-
..color = Colors.white,
347-
),
348-
),
349-
350-
const SizedBox(),
351-
Text(
352-
specialNeedsText ??
353-
(pupil.latestSupportLevel != null
354-
? 'FE\n${pupil.latestSupportLevel!.level.toString()}'
355-
: ''),
356-
textAlign: TextAlign.center,
357-
style: TextStyle(
358-
fontWeight: FontWeight.bold,
359-
fontSize: specialNeedsText != null ? 17 : 18,
360-
height: 1.1,
361-
color: specialNeedsText != null
362-
? AppColors.groupColor
363-
: AppColors.accentColor,
339+
child: Container(
340+
width: 20,
341+
height: 20,
342+
decoration: BoxDecoration(
343+
color: specialNeedsText != null
344+
? AppColors.groupColor
345+
: AppColors.accentColor,
346+
shape: BoxShape.circle,
347+
),
348+
child: Center(
349+
child: FittedBox(
350+
child: Text(
351+
specialNeedsText ??
352+
(pupil.latestSupportLevel != null
353+
? 'FE\n${pupil.latestSupportLevel!.level}'
354+
: ''),
355+
textAlign: TextAlign.center,
356+
style: const TextStyle(
357+
color: Colors.white,
358+
fontSize: 10,
359+
fontWeight: FontWeight.bold,
360+
height: 1.1,
361+
),
364362
),
365363
),
366-
],
364+
),
367365
),
368366
),
369367
),
@@ -466,31 +464,33 @@ class AvatarWithBadges extends StatelessWidget {
466464
if (pupil.religionLessonsSince != null &&
467465
pupil.religionLessonsCancelledAt == null)
468466
Positioned(
469-
left: 0,
470-
top: 38,
467+
left: 32,
468+
top: 0,
471469
child: Container(
472470
width: 20,
473471
height: 20,
474472
decoration: BoxDecoration(
475473
color: AppColors.religionColor,
476474
shape: BoxShape.circle,
477475
),
478-
child: const Center(
479-
child: Text(
480-
'R',
481-
style: TextStyle(
482-
color: Colors.white,
483-
fontSize: 10,
484-
fontWeight: FontWeight.bold,
476+
child: Center(
477+
child: FittedBox(
478+
child: Text(
479+
pupil.religion != 'isl.' ? 'Kat.' : 'Isl.',
480+
style: const TextStyle(
481+
color: Colors.white,
482+
fontSize: 10,
483+
fontWeight: FontWeight.bold,
484+
),
485485
),
486486
),
487487
),
488488
),
489489
),
490490
if (pupil.familyLanguageLessonsSince != null)
491491
Positioned(
492-
right: 0,
493-
top: 38,
492+
right: 32,
493+
top: 0,
494494
child: Container(
495495
width: 20,
496496
height: 20,
@@ -499,12 +499,14 @@ class AvatarWithBadges extends StatelessWidget {
499499
shape: BoxShape.circle,
500500
),
501501
child: const Center(
502-
child: Text(
503-
'H',
504-
style: TextStyle(
505-
color: Colors.white,
506-
fontSize: 10,
507-
fontWeight: FontWeight.bold,
502+
child: FittedBox(
503+
child: Text(
504+
'HSU',
505+
style: TextStyle(
506+
color: Colors.white,
507+
fontSize: 10,
508+
fontWeight: FontWeight.bold,
509+
),
508510
),
509511
),
510512
),

school_data_hub_flutter/lib/core/router/app_router.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,6 @@ class AppRouter {
254254
builder: (_, __) => const MatrixUsersListScreen(),
255255
),
256256

257-
// Pupil profile (extra: PupilProxy)
258-
GoRoute(
259-
path: RoutePaths.pupilProfile,
260-
builder: (_, state) => PupilProfileScreen(
261-
pupil: state.extra! as PupilProxy,
262-
),
263-
),
264257
// Utility / no-param screens
265258
GoRoute(
266259
path: RoutePaths.schoolEdit,
@@ -748,6 +741,14 @@ class AppRouter {
748741
);
749742
},
750743
),
744+
// Pupil profile — MUST be after all fixed /pupil/* routes
745+
// so that /pupil/birthdays etc. don't match /pupil/:internalId
746+
GoRoute(
747+
path: RoutePaths.pupilProfile,
748+
builder: (_, state) => PupilProfileScreen(
749+
pupil: state.extra! as PupilProxy,
750+
),
751+
),
751752
GoRoute(
752753
path: RoutePaths.utilPdfViewer,
753754
builder: (_, state) {

school_data_hub_flutter/lib/features/_pupil/domain/models/pupil_proxy.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class PupilProxy with ChangeNotifier {
1515
required PupilData pupilData,
1616
required PupilIdentity pupilIdentity,
1717
SiblingsResolver? siblingsResolver,
18-
}) : _pupilData = pupilData,
19-
_pupilIdentity = pupilIdentity {
18+
}) : _pupilData = pupilData,
19+
_pupilIdentity = pupilIdentity {
2020
_siblingsResolver = siblingsResolver;
2121
}
2222

@@ -260,5 +260,4 @@ class PupilProxy with ChangeNotifier {
260260
// schoolday related
261261

262262
List<SchooldayEvent>? get schooldayEvents => _pupilData.schooldayEvents;
263-
264263
}

school_data_hub_flutter/lib/features/app_entry_point/global_overlay_host/global_overlay_host.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:school_data_hub_flutter/common/widgets/snackbars.dart';
88
import 'package:school_data_hub_flutter/core/env/env_manager.dart';
99
import 'package:school_data_hub_flutter/core/notification_manager.dart';
1010
import 'package:school_data_hub_flutter/l10n/app_localizations.dart';
11+
import 'package:school_data_hub_flutter/main.dart' show MyApp;
1112

1213
final _log = Logger('GlobalOverlayHost');
1314

@@ -41,8 +42,11 @@ class GlobalOverlayHost extends WatchingWidget {
4142
switch (value.target) {
4243
case NotificationTarget.informationDialog:
4344
WidgetsBinding.instance.addPostFrameCallback((_) {
44-
if (context.mounted) {
45-
informationDialog(context, 'Info', value.message);
45+
// Use the router's navigator context — GlobalOverlayHost sits
46+
// above the Navigator so its own context has no Navigator ancestor.
47+
final navContext = MyApp.navigatorKey.currentContext;
48+
if (navContext != null && navContext.mounted) {
49+
informationDialog(navContext, 'Info', value.message);
4650
}
4751
});
4852
break;

school_data_hub_flutter/lib/features/books/presentation/book_search_form_screen/book_search_form_screen.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ class _BookSearchFormScreenState extends State<BookSearchFormScreen> {
152152
.push<List<BookTag>>(
153153
RoutePaths.learningBooksSelectTags,
154154
extra: {
155-
'initialSelectedTags': selectedBookTags,
155+
'initialSelectedTags':
156+
selectedBookTags,
156157
},
157158
);
158159
if (result != null) {
@@ -194,7 +195,7 @@ class _BookSearchFormScreenState extends State<BookSearchFormScreen> {
194195
),
195196
Gap(Style.spacing.sm),
196197
DropdownButtonFormField<LibraryBookLocation>(
197-
value: selectedLocation,
198+
initialValue: selectedLocation,
198199
decoration: _inputDecoration(style, labelText: 'Ablageort'),
199200
items: locationItems
200201
.map(

school_data_hub_flutter/lib/features/books/presentation/book_search_screen/book_search_result_card.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class BookSearchResultCard extends WatchingWidget {
2626
Widget build(BuildContext context) {
2727
if (group.isEmpty) return const SizedBox.shrink();
2828

29-
final style = Style.of(context);
3029
final List<LibraryBookProxy> books = group;
3130
final LibraryBookProxy bookProxy = books.first;
3231
final descriptionTileController = createOnce<ExpansionController>(

school_data_hub_flutter/lib/features/learning/competence/presentation/competence_list_screen/widgets/competence_tree.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class _CompetenceNode extends StatelessWidget {
9494
}
9595

9696
return Padding(
97-
padding: EdgeInsets.symmetric(horizontal: Style.spacing.xs),
97+
padding: EdgeInsets.symmetric(horizontal: Style.spacing.sm),
9898
child: GestureDetector(
9999
onLongPress: () async {
100100
final confirm = await confirmationDialog(

0 commit comments

Comments
 (0)