feat: Add agent profile verification status fields and display corresponding UI banners on the agent home screen.
This commit is contained in:
@@ -257,6 +257,7 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> {
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 12),
|
||||
_buildVerificationBanner(agent),
|
||||
_buildCoverAndAvatar(agent),
|
||||
const SizedBox(height: 16),
|
||||
_buildStatusSection(agent),
|
||||
@@ -278,6 +279,131 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> {
|
||||
);
|
||||
}
|
||||
|
||||
// ── Verification status banner ──
|
||||
Widget _buildVerificationBanner(AgentProfile agent) {
|
||||
final status = agent.verificationStatus;
|
||||
if (status == null || status == 'APPROVED') return const SizedBox.shrink();
|
||||
|
||||
if (status == 'REJECTED') {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 0),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFEF2F2),
|
||||
border: Border.all(color: const Color(0xFFFECACA)),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.warning_amber_rounded, size: 18, color: Colors.red[700]),
|
||||
const SizedBox(width: 8),
|
||||
Text('Profile Verification Rejected',
|
||||
style: TextStyle(fontFamily: 'Fractul', fontSize: 14, fontWeight: FontWeight.w700, color: Colors.red[800])),
|
||||
],
|
||||
),
|
||||
if (agent.verificationNote != null && agent.verificationNote!.isNotEmpty) ...[
|
||||
const SizedBox(height: 6),
|
||||
Text('Reason: ${agent.verificationNote}',
|
||||
style: TextStyle(fontFamily: 'SourceSerif4', fontSize: 13, color: Colors.red[700])),
|
||||
],
|
||||
const SizedBox(height: 8),
|
||||
Text('Please update your profile and documents, then resubmit.',
|
||||
style: TextStyle(fontFamily: 'SourceSerif4', fontSize: 13, color: Colors.red[600])),
|
||||
const SizedBox(height: 10),
|
||||
GestureDetector(
|
||||
onTap: () => context.push('/agent/edit-profile'),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accentOrange,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Text('Update & Resubmit',
|
||||
style: TextStyle(fontFamily: 'SourceSerif4', fontSize: 13, color: Colors.white, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (status == 'PENDING_REVIEW') {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFEFCE8),
|
||||
border: Border.all(color: const Color(0xFFFDE68A)),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(width: 10, height: 10, decoration: const BoxDecoration(color: Color(0xFFFBBF24), shape: BoxShape.circle)),
|
||||
const SizedBox(width: 10),
|
||||
const Expanded(
|
||||
child: Text('Profile verification is under review. You will be notified once approved.',
|
||||
style: TextStyle(fontFamily: 'Fractul', fontSize: 13, fontWeight: FontWeight.w700, color: Color(0xFF854D0E))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (status == 'NONE') {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEFF6FF),
|
||||
border: Border.all(color: const Color(0xFFBFDBFE)),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.info_outline, size: 18, color: Colors.blue[700]),
|
||||
const SizedBox(width: 8),
|
||||
const Expanded(
|
||||
child: Text('Complete your profile and upload verification documents to get verified.',
|
||||
style: TextStyle(fontFamily: 'Fractul', fontSize: 13, fontWeight: FontWeight.w700, color: Color(0xFF1E40AF))),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
GestureDetector(
|
||||
onTap: () => context.push('/agent/edit-profile'),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.accentOrange,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Text('Complete Profile',
|
||||
style: TextStyle(fontFamily: 'SourceSerif4', fontSize: 13, color: Colors.white, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
// ── Agent profile photo as cover image ──
|
||||
Widget _buildCoverAndAvatar(AgentProfile agent) {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
|
||||
Reference in New Issue
Block a user