Skip to content

Commit f3e4a5c

Browse files
client+server: massive refactor using claude 4.6
1 parent 58a9541 commit f3e4a5c

284 files changed

Lines changed: 2517 additions & 3331 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

school_data_hub_client/lib/src/protocol/client.dart

Lines changed: 286 additions & 304 deletions
Large diffs are not rendered by default.

school_data_hub_client/lib/src/protocol/protocol.dart

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -113,40 +113,40 @@ import 'package:school_data_hub_client/src/protocol/_features/learning_support/m
113113
as _i81;
114114
import 'package:school_data_hub_client/src/protocol/_features/pupil/models/pupil_data/pupil_data.dart'
115115
as _i82;
116-
import 'package:school_data_hub_client/src/protocol/_features/attendance/models/missed_schoolday.dart'
116+
import 'package:school_data_hub_client/src/protocol/_features/schoolday/models/schoolday.dart'
117117
as _i83;
118-
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i84;
118+
import 'package:school_data_hub_client/src/protocol/_features/attendance/models/missed_schoolday.dart'
119+
as _i84;
120+
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i85;
119121
import 'package:school_data_hub_client/src/protocol/_features/auth/models/user_device.dart'
120-
as _i85;
121-
import 'package:school_data_hub_client/src/protocol/_features/authorizations/models/authorization.dart'
122122
as _i86;
123-
import 'package:school_data_hub_client/src/protocol/_shared/models/member_operation.dart'
123+
import 'package:school_data_hub_client/src/protocol/_features/authorizations/models/authorization.dart'
124124
as _i87;
125-
import 'package:school_data_hub_client/src/protocol/_features/books/models/book_tagging/book_tag.dart'
125+
import 'package:school_data_hub_client/src/protocol/_shared/models/member_operation.dart'
126126
as _i88;
127-
import 'package:school_data_hub_client/src/protocol/_features/books/models/book.dart'
127+
import 'package:school_data_hub_client/src/protocol/_features/books/models/book_tagging/book_tag.dart'
128128
as _i89;
129-
import 'package:school_data_hub_client/src/protocol/_features/books/models/library_book_location.dart'
129+
import 'package:school_data_hub_client/src/protocol/_features/books/models/book.dart'
130130
as _i90;
131-
import 'package:school_data_hub_client/src/protocol/_features/books/models/library_book.dart'
131+
import 'package:school_data_hub_client/src/protocol/_features/books/models/library_book_location.dart'
132132
as _i91;
133-
import 'package:school_data_hub_client/src/protocol/_features/books/models/pupil_book_lending.dart'
133+
import 'package:school_data_hub_client/src/protocol/_features/books/models/library_book.dart'
134134
as _i92;
135-
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/learning_support_plan.dart'
135+
import 'package:school_data_hub_client/src/protocol/_features/books/models/pupil_book_lending.dart'
136136
as _i93;
137-
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/support_category_status.dart'
137+
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/learning_support_plan.dart'
138138
as _i94;
139-
import 'package:school_data_hub_client/src/protocol/_features/pupil/models/pupil_data/preschool/pre_school_medical.dart'
139+
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/support_category_status.dart'
140140
as _i95;
141-
import 'package:school_data_hub_client/src/protocol/_features/matrix/compulsory_room.dart'
141+
import 'package:school_data_hub_client/src/protocol/_features/pupil/models/pupil_data/preschool/pre_school_medical.dart'
142142
as _i96;
143-
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/support_level_legacy_dto.dart'
143+
import 'package:school_data_hub_client/src/protocol/_features/matrix/compulsory_room.dart'
144144
as _i97;
145-
import 'package:school_data_hub_client/src/protocol/_features/school_lists/models/school_list.dart'
145+
import 'package:school_data_hub_client/src/protocol/_features/learning_support/models/support_level_legacy_dto.dart'
146146
as _i98;
147-
import 'package:school_data_hub_client/src/protocol/_features/schoolday/models/school_semester.dart'
147+
import 'package:school_data_hub_client/src/protocol/_features/school_lists/models/school_list.dart'
148148
as _i99;
149-
import 'package:school_data_hub_client/src/protocol/_features/schoolday/models/schoolday.dart'
149+
import 'package:school_data_hub_client/src/protocol/_features/schoolday/models/school_semester.dart'
150150
as _i100;
151151
import 'package:school_data_hub_client/src/protocol/_features/schoolday_events/models/schoolday_event.dart'
152152
as _i101;
@@ -1212,72 +1212,79 @@ class Protocol extends _i1.SerializationManager {
12121212
return (data as List).map((e) => deserialize<_i82.PupilData>(e)).toSet()
12131213
as T;
12141214
}
1215+
if (t == List<_i83.Schoolday>) {
1216+
return (data as List).map((e) => deserialize<_i83.Schoolday>(e)).toList()
1217+
as T;
1218+
}
1219+
if (t == List<DateTime>) {
1220+
return (data as List).map((e) => deserialize<DateTime>(e)).toList() as T;
1221+
}
12151222
if (t == List<String>) {
12161223
return (data as List).map((e) => deserialize<String>(e)).toList() as T;
12171224
}
1218-
if (t == List<_i83.MissedSchoolday>) {
1225+
if (t == List<_i84.MissedSchoolday>) {
12191226
return (data as List)
1220-
.map((e) => deserialize<_i83.MissedSchoolday>(e))
1227+
.map((e) => deserialize<_i84.MissedSchoolday>(e))
12211228
.toList() as T;
12221229
}
12231230
if (t ==
12241231
_i1.getType<
12251232
({
1226-
_i84.AuthenticationResponse response,
1227-
_i85.UserDevice? userDevice
1233+
_i85.AuthenticationResponse response,
1234+
_i86.UserDevice? userDevice
12281235
})>()) {
12291236
return (
1230-
response: deserialize<_i84.AuthenticationResponse>(
1237+
response: deserialize<_i85.AuthenticationResponse>(
12311238
((data as Map)['n'] as Map)['response']),
12321239
userDevice: ((data)['n'] as Map)['userDevice'] == null
12331240
? null
1234-
: deserialize<_i85.UserDevice>(data['n']['userDevice']),
1241+
: deserialize<_i86.UserDevice>(data['n']['userDevice']),
12351242
) as T;
12361243
}
1237-
if (t == List<_i86.Authorization>) {
1244+
if (t == List<_i87.Authorization>) {
12381245
return (data as List)
1239-
.map((e) => deserialize<_i86.Authorization>(e))
1246+
.map((e) => deserialize<_i87.Authorization>(e))
12401247
.toList() as T;
12411248
}
12421249
if (t == List<int>) {
12431250
return (data as List).map((e) => deserialize<int>(e)).toList() as T;
12441251
}
12451252
if (t ==
12461253
_i1.getType<
1247-
({_i87.MemberOperation operation, List<int> pupilIds})?>()) {
1254+
({_i88.MemberOperation operation, List<int> pupilIds})?>()) {
12481255
return (data == null)
12491256
? null as T
12501257
: (
1251-
operation: deserialize<_i87.MemberOperation>(
1258+
operation: deserialize<_i88.MemberOperation>(
12521259
((data as Map)['n'] as Map)['operation']),
12531260
pupilIds: deserialize<List<int>>(data['n']['pupilIds']),
12541261
) as T;
12551262
}
1256-
if (t == List<_i88.BookTag>) {
1257-
return (data as List).map((e) => deserialize<_i88.BookTag>(e)).toList()
1263+
if (t == List<_i89.BookTag>) {
1264+
return (data as List).map((e) => deserialize<_i89.BookTag>(e)).toList()
12581265
as T;
12591266
}
1260-
if (t == List<_i89.Book>) {
1261-
return (data as List).map((e) => deserialize<_i89.Book>(e)).toList() as T;
1267+
if (t == List<_i90.Book>) {
1268+
return (data as List).map((e) => deserialize<_i90.Book>(e)).toList() as T;
12621269
}
1263-
if (t == _i1.getType<List<_i88.BookTag>?>()) {
1270+
if (t == _i1.getType<List<_i89.BookTag>?>()) {
12641271
return (data != null
1265-
? (data as List).map((e) => deserialize<_i88.BookTag>(e)).toList()
1272+
? (data as List).map((e) => deserialize<_i89.BookTag>(e)).toList()
12661273
: null) as T;
12671274
}
1268-
if (t == List<_i90.LibraryBookLocation>) {
1275+
if (t == List<_i91.LibraryBookLocation>) {
12691276
return (data as List)
1270-
.map((e) => deserialize<_i90.LibraryBookLocation>(e))
1277+
.map((e) => deserialize<_i91.LibraryBookLocation>(e))
12711278
.toList() as T;
12721279
}
1273-
if (t == List<_i91.LibraryBook>) {
1280+
if (t == List<_i92.LibraryBook>) {
12741281
return (data as List)
1275-
.map((e) => deserialize<_i91.LibraryBook>(e))
1282+
.map((e) => deserialize<_i92.LibraryBook>(e))
12761283
.toList() as T;
12771284
}
1278-
if (t == List<_i92.PupilBookLending>) {
1285+
if (t == List<_i93.PupilBookLending>) {
12791286
return (data as List)
1280-
.map((e) => deserialize<_i92.PupilBookLending>(e))
1287+
.map((e) => deserialize<_i93.PupilBookLending>(e))
12811288
.toList() as T;
12821289
}
12831290
if (t == _i1.getType<({int value})?>()) {
@@ -1338,31 +1345,31 @@ class Protocol extends _i1.SerializationManager {
13381345
deserialize<DateTime>(((data as Map)['n'] as Map)['value']),
13391346
) as T;
13401347
}
1341-
if (t == List<_i93.LearningSupportPlan>) {
1348+
if (t == List<_i94.LearningSupportPlan>) {
13421349
return (data as List)
1343-
.map((e) => deserialize<_i93.LearningSupportPlan>(e))
1350+
.map((e) => deserialize<_i94.LearningSupportPlan>(e))
13441351
.toList() as T;
13451352
}
1346-
if (t == List<_i94.SupportCategoryStatus>) {
1353+
if (t == List<_i95.SupportCategoryStatus>) {
13471354
return (data as List)
1348-
.map((e) => deserialize<_i94.SupportCategoryStatus>(e))
1355+
.map((e) => deserialize<_i95.SupportCategoryStatus>(e))
13491356
.toList() as T;
13501357
}
1351-
if (t == List<_i95.PreSchoolMedical>) {
1358+
if (t == List<_i96.PreSchoolMedical>) {
13521359
return (data as List)
1353-
.map((e) => deserialize<_i95.PreSchoolMedical>(e))
1360+
.map((e) => deserialize<_i96.PreSchoolMedical>(e))
13541361
.toList() as T;
13551362
}
1356-
if (t == _i1.getType<List<_i96.CompulsoryRoom>?>()) {
1363+
if (t == _i1.getType<List<_i97.CompulsoryRoom>?>()) {
13571364
return (data != null
13581365
? (data as List)
1359-
.map((e) => deserialize<_i96.CompulsoryRoom>(e))
1366+
.map((e) => deserialize<_i97.CompulsoryRoom>(e))
13601367
.toList()
13611368
: null) as T;
13621369
}
1363-
if (t == List<_i96.CompulsoryRoom>) {
1370+
if (t == List<_i97.CompulsoryRoom>) {
13641371
return (data as List)
1365-
.map((e) => deserialize<_i96.CompulsoryRoom>(e))
1372+
.map((e) => deserialize<_i97.CompulsoryRoom>(e))
13661373
.toList() as T;
13671374
}
13681375
if (t == List<_i82.PupilData>) {
@@ -1372,9 +1379,9 @@ class Protocol extends _i1.SerializationManager {
13721379
if (t == Set<int>) {
13731380
return (data as List).map((e) => deserialize<int>(e)).toSet() as T;
13741381
}
1375-
if (t == List<_i97.SupportLevelLegacyDto>) {
1382+
if (t == List<_i98.SupportLevelLegacyDto>) {
13761383
return (data as List)
1377-
.map((e) => deserialize<_i97.SupportLevelLegacyDto>(e))
1384+
.map((e) => deserialize<_i98.SupportLevelLegacyDto>(e))
13781385
.toList() as T;
13791386
}
13801387
if (t == _i1.getType<({DateTime? value})>()) {
@@ -1384,22 +1391,15 @@ class Protocol extends _i1.SerializationManager {
13841391
: deserialize<DateTime>(data['n']['value']),
13851392
) as T;
13861393
}
1387-
if (t == List<_i98.SchoolList>) {
1388-
return (data as List).map((e) => deserialize<_i98.SchoolList>(e)).toList()
1394+
if (t == List<_i99.SchoolList>) {
1395+
return (data as List).map((e) => deserialize<_i99.SchoolList>(e)).toList()
13891396
as T;
13901397
}
1391-
if (t == List<_i99.SchoolSemester>) {
1398+
if (t == List<_i100.SchoolSemester>) {
13921399
return (data as List)
1393-
.map((e) => deserialize<_i99.SchoolSemester>(e))
1400+
.map((e) => deserialize<_i100.SchoolSemester>(e))
13941401
.toList() as T;
13951402
}
1396-
if (t == List<_i100.Schoolday>) {
1397-
return (data as List).map((e) => deserialize<_i100.Schoolday>(e)).toList()
1398-
as T;
1399-
}
1400-
if (t == List<DateTime>) {
1401-
return (data as List).map((e) => deserialize<DateTime>(e)).toList() as T;
1402-
}
14031403
if (t == List<_i101.SchooldayEvent>) {
14041404
return (data as List)
14051405
.map((e) => deserialize<_i101.SchooldayEvent>(e))
@@ -1481,7 +1481,7 @@ class Protocol extends _i1.SerializationManager {
14811481
) as T;
14821482
}
14831483
try {
1484-
return _i84.Protocol().deserialize<T>(data, t);
1484+
return _i85.Protocol().deserialize<T>(data, t);
14851485
} on _i1.DeserializationTypeNotFoundException catch (_) {}
14861486
return super.deserialize<T>(data, t);
14871487
}
@@ -1724,7 +1724,7 @@ class Protocol extends _i1.SerializationManager {
17241724
if (data is _i79.SchoolData) {
17251725
return 'SchoolData';
17261726
}
1727-
className = _i84.Protocol().getClassNameForObject(data);
1727+
className = _i85.Protocol().getClassNameForObject(data);
17281728
if (className != null) {
17291729
return 'serverpod_auth.$className';
17301730
}
@@ -1976,7 +1976,7 @@ class Protocol extends _i1.SerializationManager {
19761976
}
19771977
if (dataClassName.startsWith('serverpod_auth.')) {
19781978
data['className'] = dataClassName.substring(15);
1979-
return _i84.Protocol().deserializeByClassName(data);
1979+
return _i85.Protocol().deserializeByClassName(data);
19801980
}
19811981
if (dataClassName == 'List<PupilData>') {
19821982
return deserialize<List<_i82.PupilData>>(data['data']);
@@ -1995,8 +1995,8 @@ Map<String, dynamic>? mapRecordToJson(Record? record) {
19951995
return null;
19961996
}
19971997
if (record is ({
1998-
_i84.AuthenticationResponse response,
1999-
_i85.UserDevice? userDevice
1998+
_i85.AuthenticationResponse response,
1999+
_i86.UserDevice? userDevice
20002000
})) {
20012001
return {
20022002
"n": {
@@ -2005,7 +2005,7 @@ Map<String, dynamic>? mapRecordToJson(Record? record) {
20052005
},
20062006
};
20072007
}
2008-
if (record is ({_i87.MemberOperation operation, List<int> pupilIds})) {
2008+
if (record is ({_i88.MemberOperation operation, List<int> pupilIds})) {
20092009
return {
20102010
"n": {
20112011
"operation": record.operation,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"dart.flutterSdkPath": "C:\\src\\flutter",
3-
"dart.sdkPath": "C:\\src\\flutter\\bin\\cache\\dart-sdk"
2+
"dart.flutterSdkPath": "C:\\Users\\p53\\.puro\\envs\\stable\\flutter",
3+
"dart.sdkPath": "C:\\Users\\p53\\.puro\\envs\\stable\\flutter\\bin\\cache\\dart-sdk"
44
}

school_data_hub_flutter/lib/app_utils/barcode_stream_scanner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// import 'package:school_data_hub_flutter/common/theme/styles.dart';
66
// import 'package:school_data_hub_flutter/common/widgets/generic_components/generic_app_bar.dart';
77
// import 'package:school_data_hub_flutter/features/pupil/domain/pupil_identity_manager.dart';
8-
// import 'package:watch_it/watch_it.dart';
8+
// import 'package:flutter_it/flutter_it.dart';
99

1010
// class BarcodeStreamScanner extends StatefulWidget {
1111
// const BarcodeStreamScanner({super.key});

school_data_hub_flutter/lib/app_utils/create_and_crop_image_file.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
77
import 'package:image_picker/image_picker.dart';
88
import 'package:path/path.dart' as p;
99
import 'package:path_provider/path_provider.dart';
10-
import 'package:watch_it/watch_it.dart';
10+
import 'package:flutter_it/flutter_it.dart';
1111

1212
Future<File?> createAndCropImageFile(context) async {
1313
XFile? image = await ImagePicker().pickImage(

school_data_hub_flutter/lib/app_utils/custom_encrypter.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:path/path.dart' as p;
88
import 'package:path_provider/path_provider.dart';
99
import 'package:school_data_hub_flutter/core/env/env_manager.dart';
1010
import 'package:school_data_hub_flutter/features/matrix/domain/matrix_policy_manager.dart';
11-
import 'package:watch_it/watch_it.dart';
11+
import 'package:flutter_it/flutter_it.dart';
1212

1313
final customEncrypter = CustomEncrypter();
1414
final _envManager = di<EnvManager>();
@@ -43,10 +43,9 @@ class CustomEncrypter {
4343
final iv = enc.IV.fromUtf8(_envManager.activeEnv!.iv!);
4444

4545
String encryptMatrixString(String nonEncryptedString) {
46-
final encryptedString =
47-
matrixCredentialsEncrypter
48-
.encrypt(nonEncryptedString, iv: matrixIv)
49-
.base64;
46+
final encryptedString = matrixCredentialsEncrypter
47+
.encrypt(nonEncryptedString, iv: matrixIv)
48+
.base64;
5049
return encryptedString;
5150
}
5251

@@ -60,8 +59,9 @@ class CustomEncrypter {
6059
}
6160

6261
String encryptString(String nonEncryptedString) {
63-
final encryptedString =
64-
encrypter.encrypt(nonEncryptedString, iv: iv).base64;
62+
final encryptedString = encrypter
63+
.encrypt(nonEncryptedString, iv: iv)
64+
.base64;
6565
return encryptedString;
6666
}
6767

@@ -89,10 +89,9 @@ class CustomEncrypter {
8989
final encryptedBytes = await file.readAsBytes();
9090

9191
// Decrypt the bytes
92-
final decryptedBytes =
93-
(kReleaseMode || kProfileMode)
94-
? await compute(customEncrypter.decryptTheseBytes, encryptedBytes)
95-
: customEncrypter.decryptTheseBytes(encryptedBytes);
92+
final decryptedBytes = (kReleaseMode || kProfileMode)
93+
? await compute(customEncrypter.decryptTheseBytes, encryptedBytes)
94+
: customEncrypter.decryptTheseBytes(encryptedBytes);
9695
return Image.memory(decryptedBytes);
9796
}
9897

school_data_hub_flutter/lib/app_utils/download_and_decrypt_file.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:path/path.dart' as p;
66
import 'package:school_data_hub_client/school_data_hub_client.dart';
77
import 'package:school_data_hub_flutter/app_utils/custom_encrypter.dart';
88
import 'package:school_data_hub_flutter/common/services/notification_service.dart';
9-
import 'package:watch_it/watch_it.dart';
9+
import 'package:flutter_it/flutter_it.dart';
1010

1111
Future<File?> downloadAndDecryptFile({
1212
required String documentId,

school_data_hub_flutter/lib/app_utils/logger/domain/exception_chain.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extension CausedByException<E extends Exception> on E {
3030

3131
/// calls [toString] appended by the caused exception, if any.
3232
String toStringWithCause() {
33-
final cause = this.getCausedByException();
33+
final cause = getCausedByException();
3434
if (cause == null) {
3535
return toString();
3636
}

school_data_hub_flutter/lib/app_utils/logger/domain/signals_logger.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// lib/app_utils/logger/signals_logger.dart
22
import 'package:school_data_hub_flutter/app_utils/logger/domain/log_service.dart';
33
import 'package:signals/signals_flutter.dart';
4-
import 'package:watch_it/watch_it.dart';
4+
import 'package:flutter_it/flutter_it.dart';
55

66
class AppSignalsObserver extends SignalsObserver {
77
bool _forwarding = false;

school_data_hub_flutter/lib/app_utils/logger/presentation/logs_page/logs_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:school_data_hub_flutter/common/widgets/generic_components/generi
66
import 'package:school_data_hub_flutter/common/widgets/generic_components/generic_sliver_list.dart';
77
import 'package:school_data_hub_flutter/common/widgets/generic_components/generic_sliver_search_app_bar.dart';
88
import 'package:signals_hooks/signals_hooks.dart';
9-
import 'package:watch_it/watch_it.dart';
9+
import 'package:flutter_it/flutter_it.dart';
1010

1111
import '../../domain/log_service.dart';
1212
import '../../model/app_log.dart';

0 commit comments

Comments
 (0)