Skip to content

Commit

Permalink
rfac: links hostel change to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
am-casper committed Apr 10, 2024
1 parent ed3d0a9 commit a692060
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HostelChangeRequest with _$HostelChangeRequest {
required int id,
required String hostelCode,
required String newRoomNo,
bool? isApproved,
bool? isApprovedByAdmin,
required String timestamp,
required int newHostel}) = _HostelChangeRequest;

Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/profile/bloc/profile_page_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ProfilePageBloc extends Bloc<ProfilePageEvent, ProfilePageState> {
newRoomNo: "",
timestamp: "",
newHostel: 0,
isApproved: null),
isApprovedByAdmin: null),
),
);
}
Expand All @@ -61,7 +61,7 @@ class ProfilePageBloc extends Bloc<ProfilePageEvent, ProfilePageState> {
newRoomNo: "",
timestamp: "",
newHostel: 0,
isApproved: null),
isApprovedByAdmin: null),
),
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/presentation/profile/profile_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ProfileScreen extends StatelessWidget {
],
),
10.toVerticalSizedBox,
if (state.hostelChangeStatus.isApproved == null)
if (state.hostelChangeStatus.isApprovedByAdmin == null)
ProfileTextButton(
title: 'Request for Hostel Change',
onPressed: () {
Expand All @@ -102,7 +102,7 @@ class ProfileScreen extends StatelessWidget {
horizontalPadding: 50,
width: 248,
),
if (state.hostelChangeStatus.isApproved != null)
if (state.hostelChangeStatus.isApprovedByAdmin != null)
TextButton(
onPressed: () => {
showDialog(
Expand Down Expand Up @@ -170,7 +170,7 @@ class ProfileScreen extends StatelessWidget {
Align(
alignment: Alignment.centerLeft,
child: Text(
"Status: Pending",
"Status: ${state.hostelChangeStatus.isApprovedByAdmin! ? 'Approved by Admin' : 'Pending'}",
textAlign: TextAlign.justify,
style: TextStyle(
color: const Color(0xFF2F2F2F),
Expand Down

0 comments on commit a692060

Please sign in to comment.