This commit is contained in:
Hamza-Ayed
2024-06-27 17:41:40 +03:00
parent ce2dfa2ff4
commit 929ecf39f9
26 changed files with 461 additions and 274 deletions

View File

@@ -73,6 +73,40 @@ class SmsSignupEgypt extends StatelessWidget {
const SizedBox(
height: 10,
),
if (registerController.isSent)
Obx(() => Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: registerController.remainingTime > 0
? Column(
children: [
Text(
'${(registerController.remainingTime / 60).floor()}:${(registerController.remainingTime % 60).toString().padLeft(2, '0')} remaining',
style: AppStyle.subtitle,
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
LinearProgressIndicator(
value: registerController.remainingTime /
300, // Assuming 300 seconds (5 minutes) total
backgroundColor: Colors.grey[300],
valueColor: AlwaysStoppedAnimation<Color>(
Theme.of(context).primaryColor),
),
],
)
: TextButton(
onPressed: () =>
registerController.sendOtpMessage(),
child: Text('Resend code'.tr),
),
),
const SizedBox(
height:
16), // Add some space after the timer or button
],
)),
Padding(
padding: const EdgeInsets.all(16.0),
child: registerController.isSent