Skip to content

Commit b5fd1b4

Browse files
user pupils auth WIP
1 parent e0a82c9 commit b5fd1b4

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

school_data_hub_flutter/lib/features/user/data/user_api_service.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import 'package:school_data_hub_client/school_data_hub_client.dart';
21
import 'package:flutter_it/flutter_it.dart';
2+
import 'package:school_data_hub_client/school_data_hub_client.dart';
33

44
/// API service for user-related operations.
55
class UserApiService {
@@ -48,6 +48,7 @@ class UserApiService {
4848
pupilsAuth: pupilsAuth,
4949
);
5050
}
51+
5152
/// Update user and UserInfo in one go. [userId] is the UserInfo id.
5253
/// [imageUrl] is stored in UserInfo when the server endpoint supports it.
5354
Future<void> updateUser({
@@ -80,16 +81,14 @@ class UserApiService {
8081
// TODO: when server supports UserInfo.imageUrl, add imageUrl to the
8182
// endpoint and pass it here (client must be regenerated).
8283
}
84+
8385
/// Reset a user's password. Returns `true` on success.
8486
Future<bool> resetPassword(String userEmail, String newPassword) async {
8587
return _client.adminUser.resetPassword(userEmail, newPassword);
8688
}
8789

8890
/// Change the current user's password. Returns `true` on success.
89-
Future<bool> changePassword(
90-
String oldPassword,
91-
String newPassword,
92-
) async {
91+
Future<bool> changePassword(String oldPassword, String newPassword) async {
9392
return _client.user.changePassword(oldPassword, newPassword);
9493
}
9594

school_data_hub_flutter/lib/features/user/presentation/create_user/create_user_page.dart

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ class CreateOrEditUserPage extends WatchingWidget {
390390
builder: (ctx) => SelectPupilsListPage(
391391
selectablePupils: pupilManager
392392
.getPupilsNotListed(
393-
watchedPupilsAuth.toList(),
394-
),
393+
watchedPupilsAuth.toList(),
394+
),
395395
),
396396
),
397397
) ??
@@ -427,21 +427,22 @@ class CreateOrEditUserPage extends WatchingWidget {
427427
itemBuilder: (context, int index) {
428428
final pupilsList = pupilManager
429429
.getPupilsFromPupilIds(
430-
watchedPupilsAuth.toList(),
431-
);
430+
watchedPupilsAuth.toList(),
431+
);
432432
PupilProxy listedPupil = pupilsList[index];
433433
return InkWell(
434434
onLongPress: () {
435435
pupilsAuth.value = watchedPupilsAuth
436-
.where((id) => id != listedPupil.internalId)
436+
.where(
437+
(id) => id != listedPupil.internalId,
438+
)
437439
.toSet();
438440
},
439441
onTap: () {
440442
Navigator.of(context).push(
441443
MaterialPageRoute(
442-
builder: (ctx) => PupilProfilePage(
443-
pupil: listedPupil,
444-
),
444+
builder: (ctx) =>
445+
PupilProfilePage(pupil: listedPupil),
445446
),
446447
);
447448
},
@@ -488,7 +489,8 @@ class CreateOrEditUserPage extends WatchingWidget {
488489
listedPupil.schoolGrade.name,
489490
style: TextStyle(
490491
fontWeight: FontWeight.bold,
491-
color: AppColors.schoolyearColor,
492+
color:
493+
AppColors.schoolyearColor,
492494
fontSize: 18,
493495
),
494496
),

school_data_hub_flutter/lib/features/user/presentation/user_list/widgets/user_list_card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import 'package:flutter_it/flutter_it.dart';
33
import 'package:gap/gap.dart';
44
import 'package:school_data_hub_client/school_data_hub_client.dart';
55
import 'package:school_data_hub_flutter/common/theme/app_colors.dart';
6-
import 'package:school_data_hub_flutter/common/widgets/custom_expansion_tile/custom_expansion_tile_controller.dart';
76
import 'package:school_data_hub_flutter/common/widgets/custom_expansion_tile/custom_expansion_tile_content.dart';
7+
import 'package:school_data_hub_flutter/common/widgets/custom_expansion_tile/custom_expansion_tile_controller.dart';
88
import 'package:school_data_hub_flutter/core/models/datetime_extensions.dart';
99
import 'package:school_data_hub_flutter/features/user/presentation/create_user/create_user_page.dart';
1010

0 commit comments

Comments
 (0)