-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deriv_auth): adding login page to single entry
- Loading branch information
1 parent
6a16570
commit 5ce30c3
Showing
9 changed files
with
87 additions
and
110 deletions.
There are no files selected for viewing
19 changes: 8 additions & 11 deletions
19
packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
import 'package:deriv_auth/features/single_entry/core/models/get_started_page_model.dart'; | ||
import 'package:deriv_auth/features/single_entry/core/models/login_page_model.dart'; | ||
|
||
/// | ||
class AuthEntryModel { | ||
/// | ||
const AuthEntryModel({ | ||
required this.slides, | ||
required this.appLogoIconPath, | ||
required this.backgroundImagePath, | ||
required this.getStartedPage, | ||
required this.loginPageModel, | ||
}); | ||
|
||
/// | ||
final List<DerivGetStartedSlideModel> slides; | ||
|
||
/// | ||
final String appLogoIconPath; | ||
/// GetStartedPage data model | ||
final GetStartedPageModel getStartedPage; | ||
|
||
/// | ||
final String backgroundImagePath; | ||
/// LoginPage data model | ||
final LoginPageModel loginPageModel; | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
|
||
/// | ||
class GetStartedPageModel { | ||
/// | ||
const GetStartedPageModel({ | ||
required this.slides, | ||
required this.appLogoIconPath, | ||
required this.backgroundImagePath, | ||
}); | ||
|
||
/// | ||
final List<DerivGetStartedSlideModel> slides; | ||
|
||
/// | ||
final String appLogoIconPath; | ||
|
||
/// | ||
final String backgroundImagePath; | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
|
||
/// LoginPageModel class | ||
class LoginPageModel { | ||
/// Initializes [LoginPageModel]. | ||
const LoginPageModel({ | ||
required this.onLoggedIn, | ||
required this.onSocialAuthButtonPressed, | ||
required this.welcomeLabel, | ||
required this.greetingLabel, | ||
this.isForgotPasswordEnabled = true, | ||
this.isCreateAccountEnabled = true, | ||
this.isSocialAuthEnabled = true, | ||
this.authErrorStateHandler, | ||
this.onLoginError, | ||
}); | ||
|
||
/// Extension of base [AuthErrorStateHandler]. If not provided, base implementation will be used. | ||
final AuthErrorStateHandler? authErrorStateHandler; | ||
|
||
/// Callback to be called when login error occurs. | ||
final Function(DerivAuthErrorState)? onLoginError; | ||
|
||
/// Callback to be called when user is logged in. | ||
final Function(DerivAuthLoggedInState) onLoggedIn; | ||
|
||
/// Callback to be called when social auth button is tapped. | ||
final void Function(SocialAuthProvider) onSocialAuthButtonPressed; | ||
|
||
/// Welcome text to be displayed on login page. | ||
final String welcomeLabel; | ||
|
||
/// Greeting text to be displayed on login page. | ||
final String greetingLabel; | ||
|
||
/// Whether to display social auth buttons. | ||
final bool isSocialAuthEnabled; | ||
|
||
/// Whether to display forgot password section. | ||
final bool isForgotPasswordEnabled; | ||
|
||
/// Whether to display create account section. | ||
final bool isCreateAccountEnabled; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/deriv_auth/lib/features/single_entry/core/models/models.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export 'auth_entry_model.dart'; | ||
export 'get_started_page_model.dart'; | ||
export 'login_page_model.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
..._auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
...s/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/deriv_auth/lib/features/single_entry/single_entry.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export 'core/models/auth_entry_model.dart'; | ||
export 'core/models/models.dart'; | ||
export 'pages/auth_entry_page.dart'; |