From a692060f241f27e2e2c6f7a5b972b30803ee4a5d Mon Sep 17 00:00:00 2001 From: Aayushmaan Date: Wed, 10 Apr 2024 23:03:59 +0530 Subject: [PATCH] rfac: links hostel change to backend --- .../models/hostel_change_request/hostel_change_request.dart | 2 +- lib/presentation/profile/bloc/profile_page_bloc.dart | 4 ++-- lib/presentation/profile/profile_view.dart | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/domain/models/hostel_change_request/hostel_change_request.dart b/lib/domain/models/hostel_change_request/hostel_change_request.dart index faf7c62c..bd21df7a 100644 --- a/lib/domain/models/hostel_change_request/hostel_change_request.dart +++ b/lib/domain/models/hostel_change_request/hostel_change_request.dart @@ -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; diff --git a/lib/presentation/profile/bloc/profile_page_bloc.dart b/lib/presentation/profile/bloc/profile_page_bloc.dart index ca9efcf9..8f1a87ea 100644 --- a/lib/presentation/profile/bloc/profile_page_bloc.dart +++ b/lib/presentation/profile/bloc/profile_page_bloc.dart @@ -40,7 +40,7 @@ class ProfilePageBloc extends Bloc { newRoomNo: "", timestamp: "", newHostel: 0, - isApproved: null), + isApprovedByAdmin: null), ), ); } @@ -61,7 +61,7 @@ class ProfilePageBloc extends Bloc { newRoomNo: "", timestamp: "", newHostel: 0, - isApproved: null), + isApprovedByAdmin: null), ), ); } diff --git a/lib/presentation/profile/profile_view.dart b/lib/presentation/profile/profile_view.dart index 854cbdac..59176ea3 100644 --- a/lib/presentation/profile/profile_view.dart +++ b/lib/presentation/profile/profile_view.dart @@ -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: () { @@ -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( @@ -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),