Feature_MPIN_OTP #46

Merged
vaibhav.surve merged 8 commits from Feature_MPIN_OTP into main 2025-06-11 09:38:35 +00:00
Showing only changes of commit 8c2d258848 - Show all commits

View File

@ -24,6 +24,19 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen>
Get.put(ForgotPasswordController());
bool get _isBetaEnvironment => ApiEndpoints.baseUrl.contains("stage");
bool _isLoading = false;
void _handleForgotPassword() async {
setState(() {
_isLoading = true;
});
await controller.onForgotPassword();
setState(() {
_isLoading = false;
});
}
@override
Widget build(BuildContext context) {
@ -96,12 +109,22 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen>
),
const SizedBox(height: 40),
MyButton.rounded(
onPressed: controller.onForgotPassword,
onPressed:
_isLoading ? null : _handleForgotPassword,
elevation: 2,
padding: MySpacing.xy(80, 16),
borderRadiusAll: 10,
backgroundColor: contentTheme.brandRed,
child: MyText.labelLarge(
backgroundColor: _isLoading ? Colors.red.withOpacity(0.6) : contentTheme.brandRed,
child: _isLoading
? const SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: MyText.labelLarge(
'Send Reset Link',
fontWeight: 700,
color: Colors.white,