Skip to content

Commit a692060

Browse files
committed
rfac: links hostel change to backend
1 parent ed3d0a9 commit a692060

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/domain/models/hostel_change_request/hostel_change_request.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class HostelChangeRequest with _$HostelChangeRequest {
1111
required int id,
1212
required String hostelCode,
1313
required String newRoomNo,
14-
bool? isApproved,
14+
bool? isApprovedByAdmin,
1515
required String timestamp,
1616
required int newHostel}) = _HostelChangeRequest;
1717

lib/presentation/profile/bloc/profile_page_bloc.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ProfilePageBloc extends Bloc<ProfilePageEvent, ProfilePageState> {
4040
newRoomNo: "",
4141
timestamp: "",
4242
newHostel: 0,
43-
isApproved: null),
43+
isApprovedByAdmin: null),
4444
),
4545
);
4646
}
@@ -61,7 +61,7 @@ class ProfilePageBloc extends Bloc<ProfilePageEvent, ProfilePageState> {
6161
newRoomNo: "",
6262
timestamp: "",
6363
newHostel: 0,
64-
isApproved: null),
64+
isApprovedByAdmin: null),
6565
),
6666
);
6767
}

lib/presentation/profile/profile_view.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ProfileScreen extends StatelessWidget {
9393
],
9494
),
9595
10.toVerticalSizedBox,
96-
if (state.hostelChangeStatus.isApproved == null)
96+
if (state.hostelChangeStatus.isApprovedByAdmin == null)
9797
ProfileTextButton(
9898
title: 'Request for Hostel Change',
9999
onPressed: () {
@@ -102,7 +102,7 @@ class ProfileScreen extends StatelessWidget {
102102
horizontalPadding: 50,
103103
width: 248,
104104
),
105-
if (state.hostelChangeStatus.isApproved != null)
105+
if (state.hostelChangeStatus.isApprovedByAdmin != null)
106106
TextButton(
107107
onPressed: () => {
108108
showDialog(
@@ -170,7 +170,7 @@ class ProfileScreen extends StatelessWidget {
170170
Align(
171171
alignment: Alignment.centerLeft,
172172
child: Text(
173-
"Status: Pending",
173+
"Status: ${state.hostelChangeStatus.isApprovedByAdmin! ? 'Approved by Admin' : 'Pending'}",
174174
textAlign: TextAlign.justify,
175175
style: TextStyle(
176176
color: const Color(0xFF2F2F2F),

0 commit comments

Comments
 (0)