Skip to content

Commit 5cb52a8

Browse files
learning support WIP
1 parent 411fa53 commit 5cb52a8

19 files changed

Lines changed: 510 additions & 467 deletions

File tree

school_data_hub_client/lib/src/protocol/client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ class EndpointLearningSupportPlan extends _i1.EndpointRef {
12161216
int supportCategoryId,
12171217
int learningSupportPlanId,
12181218
int status,
1219-
String comment,
1219+
String? comment,
12201220
String createdBy,
12211221
) =>
12221222
caller.callServerEndpoint<_i7.PupilData>(

school_data_hub_flutter/lib/common/theme/app_colors.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class AppColorPalette {
6969
required this.schooldayEventReasonChipUnselectedColor,
7070
required this.schooldayEventReasonChipSelectedColor,
7171
required this.schooldayEventReasonChipSelectedCheckColor,
72+
required this.growthIconColor1,
73+
required this.growthIconColor2,
74+
required this.growthIconColor3,
75+
required this.growthIconColor4,
7276
});
7377

7478
final AppColorSchemeKey key;
@@ -129,6 +133,10 @@ class AppColorPalette {
129133
final Color schooldayEventReasonChipUnselectedColor;
130134
final Color schooldayEventReasonChipSelectedColor;
131135
final Color schooldayEventReasonChipSelectedCheckColor;
136+
final Color growthIconColor1;
137+
final Color growthIconColor2;
138+
final Color growthIconColor3;
139+
final Color growthIconColor4;
132140

133141
AppColorPalette copyWith({
134142
AppColorSchemeKey? key,
@@ -189,6 +197,10 @@ class AppColorPalette {
189197
Color? schooldayEventReasonChipUnselectedColor,
190198
Color? schooldayEventReasonChipSelectedColor,
191199
Color? schooldayEventReasonChipSelectedCheckColor,
200+
Color? growthIconColor1,
201+
Color? growthIconColor2,
202+
Color? growthIconColor3,
203+
Color? growthIconColor4,
192204
}) {
193205
return AppColorPalette(
194206
key: key ?? this.key,
@@ -265,6 +277,10 @@ class AppColorPalette {
265277
schooldayEventReasonChipSelectedCheckColor:
266278
schooldayEventReasonChipSelectedCheckColor ??
267279
this.schooldayEventReasonChipSelectedCheckColor,
280+
growthIconColor1: growthIconColor1 ?? this.growthIconColor1,
281+
growthIconColor2: growthIconColor2 ?? this.growthIconColor2,
282+
growthIconColor3: growthIconColor3 ?? this.growthIconColor3,
283+
growthIconColor4: growthIconColor4 ?? this.growthIconColor4,
268284
);
269285
}
270286
}
@@ -334,6 +350,10 @@ class AppColorPalettes {
334350
56,
335351
56,
336352
),
353+
growthIconColor1: Color.fromARGB(255, 255, 140, 0),
354+
growthIconColor2: Color.fromARGB(255, 255, 215, 0),
355+
growthIconColor3: Color.fromARGB(255, 217, 242, 58),
356+
growthIconColor4: Color.fromARGB(255, 132, 185, 79),
337357
);
338358

339359
static final lila = classic.copyWith(
@@ -456,6 +476,10 @@ class AppColors {
456476
static Color get lernenLeistenColor => palette.lernenLeistenColor;
457477
static Color get deutschColor => palette.deutschColor;
458478
static Color get spracheSprechenColor => palette.spracheSprechenColor;
479+
static Color get growthIconColor1 => palette.growthIconColor1;
480+
static Color get growthIconColor2 => palette.growthIconColor2;
481+
static Color get growthIconColor3 => palette.growthIconColor3;
482+
static Color get growthIconColor4 => palette.growthIconColor4;
459483

460484
//- Competence colors
461485

school_data_hub_flutter/lib/common/widgets/growth_dropdown.dart

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:school_data_hub_flutter/common/theme/app_colors.dart';
23

34
class GrowthDropdown extends StatelessWidget {
45
final int dropdownValue;
@@ -48,34 +49,58 @@ List<DropdownMenuItem<int>> competenceCheckDropdownItems = [
4849
),
4950
DropdownMenuItem(
5051
value: 1,
51-
child: Image.asset(
52-
'assets/images/growth_icons/growth_1-4.png',
53-
width: 50,
54-
height: 50,
52+
child: Container(
53+
decoration: BoxDecoration(
54+
color: AppColors.growthIconColor1,
55+
shape: BoxShape.circle,
56+
),
57+
child: Image.asset(
58+
'assets/images/growth_icons/growth_1-4.png',
59+
width: 50,
60+
height: 50,
61+
),
5562
),
5663
),
5764
DropdownMenuItem(
5865
value: 2,
59-
child: Image.asset(
60-
'assets/images/growth_icons/growth_2-4.png',
61-
width: 50,
62-
height: 50,
66+
child: Container(
67+
decoration: BoxDecoration(
68+
color: AppColors.growthIconColor2,
69+
shape: BoxShape.circle,
70+
),
71+
child: Image.asset(
72+
'assets/images/growth_icons/growth_2-4.png',
73+
width: 50,
74+
height: 50,
75+
),
6376
),
6477
),
6578
DropdownMenuItem(
6679
value: 3,
67-
child: Image.asset(
68-
'assets/images/growth_icons/growth_3-4.png',
69-
width: 50,
70-
height: 50,
80+
child: Container(
81+
decoration: BoxDecoration(
82+
color: AppColors.growthIconColor3,
83+
shape: BoxShape.circle,
84+
),
85+
child: Image.asset(
86+
'assets/images/growth_icons/growth_3-4.png',
87+
width: 50,
88+
height: 50,
89+
),
7190
),
7291
),
7392
DropdownMenuItem(
7493
value: 4,
75-
child: Image.asset(
76-
'assets/images/growth_icons/growth_4-4.png',
77-
width: 50,
78-
height: 50,
94+
child: Container(
95+
decoration: BoxDecoration(
96+
color: AppColors.growthIconColor4,
97+
shape: BoxShape.circle,
98+
),
99+
child: Image.asset(
100+
'assets/images/growth_icons/growth_4-4.png',
101+
width: 50,
102+
height: 50,
103+
),
79104
),
80105
),
81106
];

school_data_hub_flutter/lib/features/app_entry_point/loading_page.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_it/flutter_it.dart';
23
import 'package:gap/gap.dart';
34
import 'package:school_data_hub_flutter/app_utils/logger/presentation/logs_page/logs_page.dart';
45
import 'package:school_data_hub_flutter/common/theme/app_colors.dart';
56
import 'package:school_data_hub_flutter/core/env/env_manager.dart';
67
import 'package:school_data_hub_flutter/l10n/app_localizations.dart';
7-
import 'package:flutter_it/flutter_it.dart';
88

99
final _envManager = di<EnvManager>();
1010

@@ -60,7 +60,9 @@ class LoadingPageState extends State<LoadingPage> {
6060
child: InkWell(
6161
onTap: () {
6262
Navigator.of(context).push(
63-
MaterialPageRoute(builder: (ctx) => const LogsPage()),
63+
MaterialPageRoute(
64+
builder: (ctx) => const LogsPage(),
65+
),
6466
);
6567
},
6668
child: const Image(

school_data_hub_flutter/lib/features/learning_support/domain/learning_support_manager.dart

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'dart:io';
44
import 'package:collection/collection.dart';
55
import 'package:file_picker/file_picker.dart';
66
import 'package:flutter/foundation.dart';
7+
import 'package:flutter_it/flutter_it.dart';
78
import 'package:school_data_hub_client/school_data_hub_client.dart';
89
import 'package:school_data_hub_flutter/app_utils/custom_encrypter.dart';
910
import 'package:school_data_hub_flutter/common/services/notification_service.dart';
@@ -12,7 +13,6 @@ import 'package:school_data_hub_flutter/core/session/hub_session_manager.dart';
1213
import 'package:school_data_hub_flutter/features/learning_support/data/learning_support_api_service.dart';
1314
import 'package:school_data_hub_flutter/features/pupil/domain/pupil_proxy_manager.dart';
1415
import 'package:school_data_hub_flutter/features/school_calendar/domain/school_calendar_manager.dart';
15-
import 'package:flutter_it/flutter_it.dart';
1616

1717
class LearningSupportManager {
1818
//- IMPORTS -//
@@ -42,6 +42,8 @@ class LearningSupportManager {
4242
required int pupilId,
4343
required int supportLevelId,
4444
required String planId,
45+
required int number,
46+
String? specialNeedsTeacher,
4547
String? comment,
4648
String? socialPedagogue,
4749
String? proffesionalsInvolved,
@@ -71,16 +73,27 @@ class LearningSupportManager {
7173
);
7274
return;
7375
}
76+
final encryptedComment = comment != null
77+
? customEncrypter.encryptString(comment)
78+
: null;
79+
final encryptedStrengthsDescription = strengthsDescription != null
80+
? customEncrypter.encryptString(strengthsDescription)
81+
: null;
82+
final encryptedProblemsDescription = problemsDescription != null
83+
? customEncrypter.encryptString(problemsDescription)
84+
: null;
7485
final plan = await _learningSupportApiService.postLearningSupportPlan(
7586
LearningSupportPlan(
7687
pupilId: pupilId,
88+
number: number,
7789
learningSupportLevelId: supportLevelId,
7890
planId: planId,
79-
comment: comment,
91+
comment: encryptedComment,
8092
socialPedagogue: socialPedagogue,
93+
specialNeedsTeacher: specialNeedsTeacher,
8194
proffesionalsInvolved: proffesionalsInvolved,
82-
strengthsDescription: strengthsDescription,
83-
problemsDescription: problemsDescription,
95+
strengthsDescription: encryptedStrengthsDescription,
96+
problemsDescription: encryptedProblemsDescription,
8497
schoolSemesterId: currentSemester.id!,
8598
createdBy: _hubSessionManager.userName!,
8699
createdAt: DateTime.now(),
@@ -110,9 +123,30 @@ class LearningSupportManager {
110123

111124
Future<bool> updateLearningSupportPlan({
112125
required LearningSupportPlan plan,
126+
required String? comment,
127+
required String? socialPedagogue,
128+
required String? proffesionalsInvolved,
129+
required String? strengthsDescription,
130+
required String? problemsDescription,
113131
}) async {
132+
final encryptedComment = comment != null
133+
? customEncrypter.encryptString(comment)
134+
: null;
135+
final encryptedStrengthsDescription = strengthsDescription != null
136+
? customEncrypter.encryptString(strengthsDescription)
137+
: null;
138+
final encryptedProblemsDescription = problemsDescription != null
139+
? customEncrypter.encryptString(problemsDescription)
140+
: null;
141+
final updatedPlan = plan.copyWith(
142+
comment: encryptedComment,
143+
socialPedagogue: socialPedagogue,
144+
proffesionalsInvolved: proffesionalsInvolved,
145+
strengthsDescription: encryptedStrengthsDescription,
146+
problemsDescription: encryptedProblemsDescription,
147+
);
114148
final success = await _learningSupportApiService.updateLearningSupportPlan(
115-
plan,
149+
updatedPlan,
116150
);
117151

118152
if (!success) {
@@ -163,13 +197,16 @@ class LearningSupportManager {
163197
);
164198
return;
165199
}
200+
final encryptedComment = comment != null
201+
? customEncrypter.encryptString(comment)
202+
: null;
166203
final updatedPupil = await ClientHelper.apiCall(
167204
call: () => _learningSupportApiService.postSupportCategoryStatus(
168205
pupilId: pupilId,
169206
supportCategoryId: supportCategoryId,
170207
learningSupportPlanId: learningSupportPlan.id!,
171208
status: status,
172-
comment: comment,
209+
comment: encryptedComment,
173210
createdBy: _hubSessionManager.userName!,
174211
),
175212
);

0 commit comments

Comments
 (0)