mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-28 01:58:46 +00:00
desktop login loading indicator
This commit is contained in:
parent
2ec1bda6f2
commit
d326c10f42
1 changed files with 16 additions and 0 deletions
|
@ -17,6 +17,7 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||
import 'package:stackwallet/widgets/stack_text_field.dart';
|
||||
|
||||
class DesktopLoginView extends ConsumerStatefulWidget {
|
||||
|
@ -45,6 +46,15 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
|
||||
Future<void> login() async {
|
||||
try {
|
||||
unawaited(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => const LoadingIndicator(
|
||||
width: 200,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
await ref
|
||||
.read(storageCryptoHandlerProvider)
|
||||
.initFromExisting(passwordController.text);
|
||||
|
@ -55,6 +65,9 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
|
||||
// if no errors passphrase is correct
|
||||
if (mounted) {
|
||||
// pop loading indicator
|
||||
Navigator.of(context).pop();
|
||||
|
||||
unawaited(
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
DesktopHomeView.routeName,
|
||||
|
@ -63,6 +76,9 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
);
|
||||
}
|
||||
} catch (e) {
|
||||
// pop loading indicator
|
||||
Navigator.of(context).pop();
|
||||
|
||||
await showFloatingFlushBar(
|
||||
type: FlushBarType.warning,
|
||||
message: e.toString(),
|
||||
|
|
Loading…
Reference in a new issue