-
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.
Merge pull request #314 from sahani-deriv/auth-ui-update
feat: update_auth_ui
- Loading branch information
Showing
59 changed files
with
1,962 additions
and
440 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
packages/deriv_auth_ui/example/lib/core/example_auth_error_state_handler.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,16 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
import 'package:deriv_auth_ui/deriv_auth_ui.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
final class ExampleAuthErrorStateHandler extends AuthErrorStateHandler { | ||
ExampleAuthErrorStateHandler({required super.context}); | ||
|
||
@override | ||
void onInvalidCredentials(DerivAuthErrorState state) { | ||
ScaffoldMessenger.of(context).showSnackBar( | ||
SnackBar( | ||
content: Text(state.message), | ||
), | ||
); | ||
} | ||
} |
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
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
51 changes: 51 additions & 0 deletions
51
packages/deriv_auth_ui/example/lib/features/reset_pass/pages/reset_pass_success_page.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,51 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
import 'package:deriv_auth_ui/deriv_auth_ui.dart'; | ||
import 'package:example/features/get_started/pages/get_started_page.dart'; | ||
import 'package:example/features/login/pages/login_page.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class ResetPassSuccessPage extends StatefulWidget { | ||
const ResetPassSuccessPage({super.key}); | ||
|
||
@override | ||
State<ResetPassSuccessPage> createState() => _ResetPassSuccessPageState(); | ||
} | ||
|
||
class _ResetPassSuccessPageState extends State<ResetPassSuccessPage> { | ||
static const Duration _successPageHoldDuration = Duration(seconds: 2); | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
// wait for either [_successPageHoldDuration] or logout to finish | ||
// then navigate to loginPage | ||
Future.wait<void>( | ||
<Future<void>>[ | ||
Future<void>.delayed(_successPageHoldDuration), | ||
BlocProvider.of<DerivAuthCubit>(context).logout(), | ||
], | ||
).then( | ||
(_) { | ||
Navigator.of(context).pushAndRemoveUntil( | ||
MaterialPageRoute( | ||
builder: (context) => const GetStartedPage(), | ||
), | ||
(route) => false, | ||
); | ||
|
||
Navigator.of(context).push( | ||
MaterialPageRoute( | ||
builder: (context) => const LoginPage(), | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const DerivSuccessPassChangeLayout(); | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -16,15 +16,15 @@ dependencies: | |
path: ../ | ||
deriv_auth: | ||
git: | ||
url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
url: [email protected]:sahani-deriv/flutter-deriv-packages.git | ||
path: packages/deriv_auth | ||
ref: dev | ||
ref: auth-ui-update | ||
|
||
deriv_theme: | ||
path: ../../deriv_theme | ||
# git: | ||
# url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
# path: packages/deriv_theme | ||
# ref: dev | ||
git: | ||
url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
path: packages/deriv_theme | ||
ref: dev | ||
flutter_bloc: ^8.1.3 | ||
http: ^0.13.6 | ||
|
||
|
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
Oops, something went wrong.