Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 71 additions & 31 deletions app/lib/screens/identity_verification_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,37 @@ class _IdentityVerificationScreenState
)
],
),
if (step == 1)
ValueListenableBuilder<int>(
valueListenable: countdownNotifier,
builder:
(context, countdownValue, child) {
if (countdownValue > 0) {
return Row(
children: <Widget>[
Expanded(
child: Text(
'Verification email sent, retry in $countdownValue second${countdownValue == 1 ? '' : 's'}',
overflow: TextOverflow.clip,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
fontWeight:
FontWeight.bold,
color:
Theme.of(context)
.colorScheme
.warning),
),
),
],
);
} else {
return Container();
}
},
),
step == 2 &&
Globals().hidePhoneButton.value ==
true
Expand Down Expand Up @@ -1019,37 +1050,46 @@ class _IdentityVerificationScreenState
]))),
Globals().hidePhoneButton.value == true && step == 2
? Container()
: Padding(
padding: const EdgeInsets.only(left: 15),
child: ElevatedButton(
onPressed: () async {
switch (step) {
// Verify email
case 1:
{
verifyEmail();
}
break;

// Verify phone
case 2:
{
await verifyPhone();
}
break;

// Verify identity
case 3:
{
await verifyIdentityProcess();
}
break;
default:
{}
break;
}
},
child: const Text('Verify'))),
: ValueListenableBuilder(
valueListenable: countdownNotifier,
builder: (context, countdownValue, child) {
return Padding(
padding: const EdgeInsets.only(left: 12),
child: ElevatedButton(
onPressed: countdownValue > 0
? null
: () async {
switch (step) {
// Verify email
case 1:
{
startOrResumeEmailCountdown(
startNew: true);
verifyEmail();
}
break;

// Verify phone
case 2:
{
await verifyPhone();
}
break;

// Verify identity
case 3:
{
await verifyIdentityProcess();
}
break;
default:
{}
break;
}
},
child: const Text('Verify')),
);
})
],
),
))
Expand Down