feat: Introduce AttireVerificationStatus enum and add verificationId to staff attire items.
This commit is contained in:
@@ -74,18 +74,26 @@ class _AttireCapturePageState extends State<AttireCapturePage> {
|
||||
state.photoUrl ?? widget.initialPhotoUrl;
|
||||
final bool hasUploadedPhoto = currentPhotoUrl != null;
|
||||
|
||||
final String statusText =
|
||||
widget.item.verificationStatus ??
|
||||
(hasUploadedPhoto
|
||||
? 'Pending Verification'
|
||||
: 'Not Uploaded');
|
||||
final String statusText = switch (widget
|
||||
.item
|
||||
.verificationStatus) {
|
||||
AttireVerificationStatus.success => 'Approved',
|
||||
AttireVerificationStatus.failed => 'Rejected',
|
||||
AttireVerificationStatus.pending => 'Pending Verification',
|
||||
_ =>
|
||||
hasUploadedPhoto ? 'Pending Verification' : 'Not Uploaded',
|
||||
};
|
||||
|
||||
final Color statusColor =
|
||||
widget.item.verificationStatus == 'SUCCESS'
|
||||
? UiColors.textPrimary
|
||||
: (hasUploadedPhoto
|
||||
? UiColors.textWarning
|
||||
: UiColors.textInactive);
|
||||
switch (widget.item.verificationStatus) {
|
||||
AttireVerificationStatus.success => UiColors.textSuccess,
|
||||
AttireVerificationStatus.failed => UiColors.textError,
|
||||
AttireVerificationStatus.pending => UiColors.textWarning,
|
||||
_ =>
|
||||
hasUploadedPhoto
|
||||
? UiColors.textWarning
|
||||
: UiColors.textInactive,
|
||||
};
|
||||
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -19,7 +19,12 @@ class AttireItemCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool hasPhoto = item.photoUrl != null;
|
||||
final String statusText = item.verificationStatus ?? 'Not Uploaded';
|
||||
final String statusText = switch (item.verificationStatus) {
|
||||
AttireVerificationStatus.success => 'Approved',
|
||||
AttireVerificationStatus.failed => 'Rejected',
|
||||
AttireVerificationStatus.pending => 'Pending',
|
||||
_ => hasPhoto ? 'Pending' : 'To Do',
|
||||
};
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
|
||||
Reference in New Issue
Block a user