sca treezor and auth interceptors, some other fixes and lottie animation for app loading added
This commit is contained in:
@@ -44,7 +44,7 @@ class PaymentMethodsScreen extends ConsumerWidget {
|
||||
if (viewState.isDeleting)
|
||||
Container(
|
||||
color: Colors.black26,
|
||||
child: const Center(child: CircularProgressIndicator()),
|
||||
child: const Center(child: AppLoadingIndicator()),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -57,7 +57,7 @@ class PaymentMethodsScreen extends ConsumerWidget {
|
||||
PaymentMethodsViewState viewState,
|
||||
) {
|
||||
if (viewState.isLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: AppLoadingIndicator());
|
||||
}
|
||||
|
||||
if (viewState.errorMessage.isNotEmpty) {
|
||||
|
||||
@@ -98,7 +98,7 @@ class PayoutScreen extends ConsumerWidget {
|
||||
) {
|
||||
switch (viewState.step) {
|
||||
case PayoutStep.loading:
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: AppLoadingIndicator());
|
||||
case PayoutStep.beneficiaryList:
|
||||
return _buildBeneficiaryList(context, ref, theme, viewState);
|
||||
case PayoutStep.addBeneficiary:
|
||||
@@ -126,14 +126,6 @@ class PayoutScreen extends ConsumerWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
if (viewState.errorMessage.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Text(
|
||||
viewState.errorMessage,
|
||||
style: const TextStyle(color: Colors.red, fontSize: 13),
|
||||
),
|
||||
),
|
||||
if (viewState.beneficiaries.isEmpty) ...[
|
||||
const SizedBox(height: 32),
|
||||
Icon(
|
||||
@@ -287,18 +279,9 @@ class PayoutScreen extends ConsumerWidget {
|
||||
label: context.translate(I18n.payoutHolderNameLabel),
|
||||
hint: context.translate(I18n.payoutHolderNameHint),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (viewState.errorMessage.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: Text(
|
||||
viewState.errorMessage,
|
||||
style: const TextStyle(color: Colors.red, fontSize: 13),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (viewState.isSubmitting)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
const Center(child: AppLoadingIndicator(size: 48))
|
||||
else ...[
|
||||
PrimaryButton(
|
||||
text: context.translate(I18n.payoutAddBeneficiary),
|
||||
@@ -371,18 +354,9 @@ class PayoutScreen extends ConsumerWidget {
|
||||
label: context.translate(I18n.payoutAmountLabel),
|
||||
hint: '0.00',
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (viewState.errorMessage.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: Text(
|
||||
viewState.errorMessage,
|
||||
style: const TextStyle(color: Colors.red, fontSize: 13),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (viewState.isSubmitting)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
const Center(child: AppLoadingIndicator(size: 48))
|
||||
else ...[
|
||||
PrimaryButton(
|
||||
text: context.translate(I18n.payoutButton),
|
||||
@@ -438,6 +412,6 @@ class PayoutScreen extends ConsumerWidget {
|
||||
}
|
||||
|
||||
Widget _buildSuccess(BuildContext context, ThemePort theme) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: AppLoadingIndicator());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,18 +286,20 @@ class PayoutViewModel extends Notifier<PayoutViewState> {
|
||||
if (!ref.mounted) return;
|
||||
|
||||
final url = 'https://savefamily.sandbox.treezor.co/v1/payouts';
|
||||
final scaInput = {
|
||||
'url': url,
|
||||
'body': {
|
||||
'walletId': int.parse(state.walletId),
|
||||
'amount': amount.toStringAsFixed(2),
|
||||
'currency': 'EUR',
|
||||
'beneficiaryId': beneficiary.id,
|
||||
'beneficiaryValidationId': beneficiaryValidationId,
|
||||
},
|
||||
};
|
||||
debugPrint('[Payout] SCA input: ${jsonEncode(scaInput)}');
|
||||
final scaProof = await _signatureService.generateJwsWithPin(
|
||||
message: '',
|
||||
input: jsonEncode({
|
||||
'url': url,
|
||||
'body': {
|
||||
'walletId': state.walletId,
|
||||
'amount': amount,
|
||||
'currency': 'EUR',
|
||||
'beneficiaryId': beneficiary.id,
|
||||
'beneficiaryValidationId': beneficiaryValidationId,
|
||||
},
|
||||
}),
|
||||
input: jsonEncode(scaInput),
|
||||
pin: pin,
|
||||
);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class ProfileSettingsScreen extends ConsumerWidget {
|
||||
if (viewState.isLoading) {
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
body: const Center(child: CircularProgressIndicator()),
|
||||
body: const Center(child: AppLoadingIndicator()),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -661,7 +661,7 @@ class ProfileSettingsScreen extends ConsumerWidget {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (_) => const Center(child: CircularProgressIndicator()),
|
||||
builder: (_) => const Center(child: AppLoadingIndicator()),
|
||||
);
|
||||
try {
|
||||
await ref.read(logoutProvider.future);
|
||||
|
||||
@@ -38,7 +38,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
ProfileViewState viewState,
|
||||
) {
|
||||
if (viewState.isLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: AppLoadingIndicator());
|
||||
}
|
||||
|
||||
if (viewState.errorMessage.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user