From 45927ed8f1bfb50f38281fa265ea97c5398645ab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 24 Nov 2020 11:06:56 +0200 Subject: [PATCH] ES-185:fix resend opt --- .../viewModels/authentication_view_model.dart | 1 + lib/pages/authentication/verification_page.dart | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/core/viewModels/authentication_view_model.dart b/lib/core/viewModels/authentication_view_model.dart index d0ba4f0..3329a07 100644 --- a/lib/core/viewModels/authentication_view_model.dart +++ b/lib/core/viewModels/authentication_view_model.dart @@ -13,6 +13,7 @@ class AuthenticationViewModel with ChangeNotifier { AuthenticationService _authenticationService = locator(); AuthenticatedUser user; + int get userId => _authenticationService.userID; bool isLogin = false; bool isLoading = false; bool isError = false; diff --git a/lib/pages/authentication/verification_page.dart b/lib/pages/authentication/verification_page.dart index 4007153..c0051eb 100644 --- a/lib/pages/authentication/verification_page.dart +++ b/lib/pages/authentication/verification_page.dart @@ -356,11 +356,17 @@ class VerificationPage extends StatelessWidget { ForgetPasswordPage()), ); }, - child: Text( - "Resend OPT?", - style: TextStyle( - fontSize: 14, - color: Theme.of(context).primaryColor), + child: InkWell( + onTap: () async { + await authenticationViewModel + .getOpt(authenticationViewModel.userId); + }, + child: Text( + "Resend OPT?", + style: TextStyle( + fontSize: 14, + color: Theme.of(context).primaryColor), + ), ), ), ],