11import 'package:flutter/material.dart' ;
2+ import 'package:flutter_it/flutter_it.dart' ;
23import 'package:gap/gap.dart' ;
34import 'package:school_data_hub_client/school_data_hub_client.dart' ;
45import 'package:school_data_hub_flutter/common/services/notification_service.dart' ;
@@ -8,7 +9,6 @@ import 'package:school_data_hub_flutter/features/learning_support/domain/learnin
89import 'package:school_data_hub_flutter/features/learning_support/domain/support_category_manager.dart' ;
910import 'package:school_data_hub_flutter/features/learning_support/services/pdf/learning_support_plan_pdf_generator.dart' ;
1011import 'package:school_data_hub_flutter/features/pupil/domain/models/pupil_proxy.dart' ;
11- import 'package:flutter_it/flutter_it.dart' ;
1212
1313/// A card widget for displaying and editing a learning support plan.
1414///
@@ -51,14 +51,18 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
5151
5252 void _initControllers () {
5353 _commentController = TextEditingController (text: plan.comment ?? '' );
54- _socialPedagogueController =
55- TextEditingController (text: plan.socialPedagogue ?? '' );
56- _professionalsInvolvedController =
57- TextEditingController (text: plan.proffesionalsInvolved ?? '' );
58- _strengthsDescriptionController =
59- TextEditingController (text: plan.strengthsDescription ?? '' );
60- _problemsDescriptionController =
61- TextEditingController (text: plan.problemsDescription ?? '' );
54+ _socialPedagogueController = TextEditingController (
55+ text: plan.socialPedagogue ?? '' ,
56+ );
57+ _professionalsInvolvedController = TextEditingController (
58+ text: plan.proffesionalsInvolved ?? '' ,
59+ );
60+ _strengthsDescriptionController = TextEditingController (
61+ text: plan.strengthsDescription ?? '' ,
62+ );
63+ _problemsDescriptionController = TextEditingController (
64+ text: plan.problemsDescription ?? '' ,
65+ );
6266 }
6367
6468 @override
@@ -67,12 +71,9 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
6771 if (oldWidget.plan != widget.plan && ! _isEditing) {
6872 _commentController.text = plan.comment ?? '' ;
6973 _socialPedagogueController.text = plan.socialPedagogue ?? '' ;
70- _professionalsInvolvedController.text =
71- plan.proffesionalsInvolved ?? '' ;
72- _strengthsDescriptionController.text =
73- plan.strengthsDescription ?? '' ;
74- _problemsDescriptionController.text =
75- plan.problemsDescription ?? '' ;
74+ _professionalsInvolvedController.text = plan.proffesionalsInvolved ?? '' ;
75+ _strengthsDescriptionController.text = plan.strengthsDescription ?? '' ;
76+ _problemsDescriptionController.text = plan.problemsDescription ?? '' ;
7677 }
7778 }
7879
@@ -90,12 +91,9 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
9091 setState (() {
9192 _commentController.text = plan.comment ?? '' ;
9293 _socialPedagogueController.text = plan.socialPedagogue ?? '' ;
93- _professionalsInvolvedController.text =
94- plan.proffesionalsInvolved ?? '' ;
95- _strengthsDescriptionController.text =
96- plan.strengthsDescription ?? '' ;
97- _problemsDescriptionController.text =
98- plan.problemsDescription ?? '' ;
94+ _professionalsInvolvedController.text = plan.proffesionalsInvolved ?? '' ;
95+ _strengthsDescriptionController.text = plan.strengthsDescription ?? '' ;
96+ _problemsDescriptionController.text = plan.problemsDescription ?? '' ;
9997 _isEditing = true ;
10098 });
10199 }
@@ -118,16 +116,14 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
118116 : _socialPedagogueController.text.trim (),
119117 proffesionalsInvolved:
120118 _professionalsInvolvedController.text.trim ().isEmpty
121- ? null
122- : _professionalsInvolvedController.text.trim (),
123- strengthsDescription:
124- _strengthsDescriptionController.text.trim ().isEmpty
125- ? null
126- : _strengthsDescriptionController.text.trim (),
127- problemsDescription:
128- _problemsDescriptionController.text.trim ().isEmpty
129- ? null
130- : _problemsDescriptionController.text.trim (),
119+ ? null
120+ : _professionalsInvolvedController.text.trim (),
121+ strengthsDescription: _strengthsDescriptionController.text.trim ().isEmpty
122+ ? null
123+ : _strengthsDescriptionController.text.trim (),
124+ problemsDescription: _problemsDescriptionController.text.trim ().isEmpty
125+ ? null
126+ : _problemsDescriptionController.text.trim (),
131127 );
132128
133129 final success = await di <LearningSupportManager >()
@@ -150,10 +146,10 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
150146
151147 final file =
152148 await LearningSupportPlanPdfGenerator .generateLearningSupportPlanPdf (
153- plan: plan,
154- pupil: pupil,
155- supportCategories: supportCategories,
156- );
149+ plan: plan,
150+ pupil: pupil,
151+ supportCategories: supportCategories,
152+ );
157153
158154 if (mounted) {
159155 Navigator .of (context).push (
@@ -173,7 +169,7 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
173169 @override
174170 Widget build (BuildContext context) {
175171 return Card (
176- margin: const EdgeInsets .symmetric (horizontal: 16 .0 , vertical: 4.0 ),
172+ margin: const EdgeInsets .symmetric (horizontal: 5 .0 , vertical: 4.0 ),
177173 child: Padding (
178174 padding: const EdgeInsets .all (16.0 ),
179175 child: Column (
@@ -199,34 +195,11 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
199195 children: [
200196 Expanded (
201197 child: Text (
202- plan.planId,
203- style: const TextStyle (
204- fontSize: 16 ,
205- fontWeight: FontWeight .bold,
206- ),
207- ),
208- ),
209- Container (
210- padding: const EdgeInsets .symmetric (
211- horizontal: 8.0 ,
212- vertical: 4.0 ,
213- ),
214- decoration: BoxDecoration (
215- color: AppColors .backgroundColor.withValues (alpha: 0.1 ),
216- borderRadius: BorderRadius .circular (12.0 ),
217- border: Border .all (
218- color: AppColors .backgroundColor.withValues (alpha: 0.3 ),
219- ),
220- ),
221- child: Text (
222- 'Förderebene ${plan .learningSupportLevelId }' ,
223- style: TextStyle (
224- fontSize: 12 ,
225- fontWeight: FontWeight .w500,
226- color: AppColors .backgroundColor,
227- ),
198+ 'Förderplan Nr. ${plan .planId }' ,
199+ style: const TextStyle (fontSize: 16 , fontWeight: FontWeight .bold),
228200 ),
229201 ),
202+
230203 const Gap (10 ),
231204 // Edit Button
232205 InkWell (
@@ -299,15 +272,6 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
299272 return Column (
300273 crossAxisAlignment: CrossAxisAlignment .start,
301274 children: [
302- if (plan.comment? .isNotEmpty ?? false ) ...[
303- const Gap (8 ),
304- const Text (
305- 'Kommentar:' ,
306- style: TextStyle (fontSize: 12 , fontWeight: FontWeight .w500),
307- ),
308- const Gap (2 ),
309- Text (plan.comment! , style: const TextStyle (fontSize: 12 )),
310- ],
311275 if (plan.socialPedagogue? .isNotEmpty ?? false ) ...[
312276 const Gap (8 ),
313277 const Text (
@@ -348,10 +312,16 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
348312 style: TextStyle (fontSize: 12 , fontWeight: FontWeight .w500),
349313 ),
350314 const Gap (2 ),
351- Text (
352- plan.problemsDescription! ,
353- style: const TextStyle (fontSize: 12 ),
315+ Text (plan.problemsDescription! , style: const TextStyle (fontSize: 12 )),
316+ ],
317+ if (plan.comment? .isNotEmpty ?? false ) ...[
318+ const Gap (8 ),
319+ const Text (
320+ 'Ergänzende Hinweise und Absprachen:' ,
321+ style: TextStyle (fontSize: 12 , fontWeight: FontWeight .w500),
354322 ),
323+ const Gap (2 ),
324+ Text (plan.comment! , style: const TextStyle (fontSize: 12 )),
355325 ],
356326 ],
357327 );
@@ -366,14 +336,15 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
366336 const Gap (8 ),
367337
368338 // Comment field
369- const Text ('Kommentar:' , style: AppStyles .textLabel),
339+ const Text (
340+ 'Ergänze Hinweise und Absprachen:' ,
341+ style: AppStyles .textLabel,
342+ ),
370343 const Gap (4 ),
371344 TextField (
372345 controller: _commentController,
373346 maxLines: 3 ,
374- decoration: AppStyles .textFieldDecoration (
375- labelText: 'Kommentar' ,
376- ),
347+ decoration: AppStyles .textFieldDecoration (labelText: 'Kommentar' ),
377348 ),
378349
379350 const Gap (12 ),
@@ -456,10 +427,7 @@ class _LearningSupportPlanCardState extends State<LearningSupportPlanCard> {
456427 color: Colors .white,
457428 ),
458429 )
459- : const Text (
460- 'SPEICHERN' ,
461- style: AppStyles .buttonTextStyle,
462- ),
430+ : const Text ('SPEICHERN' , style: AppStyles .buttonTextStyle),
463431 ),
464432 ),
465433 ],
0 commit comments