sca treezor and auth interceptors, some other fixes and lottie animation for app loading added
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
@@ -14,7 +15,7 @@ class LoadingScreen extends StatelessWidget{
|
||||
children: [
|
||||
Spacer(flex: 8),
|
||||
SvgPicture.asset("assets/images/ui/logo_sf.svg"),
|
||||
CircularProgressIndicator(),
|
||||
AppLoadingIndicator(),
|
||||
Spacer(flex: 10)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LoadingGoogleScreen extends StatelessWidget {
|
||||
@@ -16,7 +17,7 @@ class LoadingGoogleScreen extends StatelessWidget {
|
||||
"Continuar con Google",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
|
||||
),
|
||||
CircularProgressIndicator(),
|
||||
AppLoadingIndicator(),
|
||||
Text("Redirigiendo a Google"),
|
||||
Spacer(flex: 10),
|
||||
],
|
||||
|
||||
@@ -125,7 +125,7 @@ class LoginScreen extends ConsumerWidget {
|
||||
if (!context.mounted) return;
|
||||
|
||||
if (verified == true) {
|
||||
navigationContract.goTo(AppRoutes.scaTreezor);
|
||||
navigationContract.goTo('${AppRoutes.scaTreezor}?fromLogin=true');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,14 @@ class SCATreezorBuilder {
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
final navigationContract = GetIt.I<NavigationContract>();
|
||||
final fromLogin = state.uri.queryParameters['fromLogin'] == 'true';
|
||||
|
||||
return MaterialPage<void>(
|
||||
key: state.pageKey,
|
||||
child: SCATreezorScreen(navigationContract: navigationContract),
|
||||
child: SCATreezorScreen(
|
||||
navigationContract: navigationContract,
|
||||
showCloseButton: fromLogin,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,13 @@ import 'sca_treezor_view_state.dart';
|
||||
|
||||
class SCATreezorScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
final bool showCloseButton;
|
||||
|
||||
const SCATreezorScreen({super.key, required this.navigationContract});
|
||||
const SCATreezorScreen({
|
||||
super.key,
|
||||
required this.navigationContract,
|
||||
this.showCloseButton = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -37,24 +42,25 @@ class SCATreezorScreen extends ConsumerWidget {
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 8, right: 8),
|
||||
child: IconButton(
|
||||
onPressed: state.isProcessing
|
||||
? null
|
||||
: () => navigationContract.goTo(AppRoutes.login),
|
||||
icon: const Icon(Icons.close),
|
||||
if (showCloseButton)
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 8, right: 8),
|
||||
child: IconButton(
|
||||
onPressed: state.isProcessing
|
||||
? null
|
||||
: () => navigationContract.goTo(AppRoutes.login),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: state.isLoading
|
||||
? const CircularProgressIndicator()
|
||||
? const AppLoadingIndicator()
|
||||
: state.isProvisioned
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -126,7 +132,7 @@ class _ProvisioningBody extends ConsumerWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
const CircularProgressIndicator(),
|
||||
const AppLoadingIndicator(),
|
||||
const SizedBox(height: 8),
|
||||
Text(context.translate(I18n.scaProvisioning)),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user