Skip to content

Commit

Permalink
Addition of onLoginTap callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest-deriv committed May 5, 2024
1 parent c3ef9f5 commit 0f221ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class LoginPageModel {
this.isSocialAuthEnabled = true,
this.authErrorStateHandler,
this.onLoginError,
this.onLoginTapped,
});

/// Extension of base [AuthErrorStateHandler]. If not provided, base implementation will be used.
Expand Down Expand Up @@ -55,4 +56,8 @@ class LoginPageModel {

/// Callback for web view error.
final Function(String) onWebViewError;

/// Callback to be called when login button is tapped.
/// Give access to email and password.
final Function(String email, String password)? onLoginTapped;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class _LoginPageState extends State<LoginPage> {

@override
Widget build(BuildContext context) => DerivLoginLayout(
onLoginTapped: AuthData().data.loginPageModel.onLoginTapped,
welcomeLabel: AuthData().data.loginPageModel.welcomeLabel,
greetingLabel: AuthData().data.loginPageModel.greetingLabel,
onLoggedIn: AuthData().data.loginPageModel.onLoggedIn,
Expand Down

0 comments on commit 0f221ae

Please sign in to comment.