completed velocity integration
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:qpay/models/responsive_policy.dart';
|
||||
import 'package:qpay/screens/transaction_controller.dart';
|
||||
import 'package:skeletonizer/skeletonizer.dart';
|
||||
import 'package:qpay/widgets/step_loading_widget.dart';
|
||||
|
||||
import 'integration_controller.dart';
|
||||
|
||||
@@ -18,8 +17,6 @@ class _IntegrationScreenState extends State<IntegrationScreen> {
|
||||
late IntegrationController controller;
|
||||
late TransactionController transactionController;
|
||||
|
||||
bool integrating = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -32,19 +29,6 @@ class _IntegrationScreenState extends State<IntegrationScreen> {
|
||||
controller.doIntegration();
|
||||
}
|
||||
|
||||
void _showErrorSnackBar(String? message) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message.toString()),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
backgroundColor: Colors.deepOrange,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
@@ -56,6 +40,10 @@ class _IntegrationScreenState extends State<IntegrationScreen> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Completing your transaction'),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => context.go('/'),
|
||||
),
|
||||
),
|
||||
body: ListenableBuilder(
|
||||
listenable: controller,
|
||||
@@ -66,60 +54,18 @@ class _IntegrationScreenState extends State<IntegrationScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.all(50),
|
||||
child: Center(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SizedBox(
|
||||
width: double.parse(constraints.maxWidth > ResponsivePolicy.md ?
|
||||
ResponsivePolicy.md.toString() :
|
||||
constraints.maxWidth.toString()),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 75),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'We\'ve successfully collected your funds. We are now '
|
||||
'updating your billing account. This won\'t take long',
|
||||
style: TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 50,),
|
||||
Image.asset('assets/velocity-animation.gif', width: 150),
|
||||
SizedBox(height: 50),
|
||||
if(controller.model.status == 'FAILED')
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'We failed to update your billing account',
|
||||
style: TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
Skeletonizer(
|
||||
enabled: controller.model.isLoading,
|
||||
child: OutlinedButton(
|
||||
child: Text('Retry'),
|
||||
onPressed: () {
|
||||
controller.doIntegration();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
return StepLoadingWidget(
|
||||
currentStep: 2,
|
||||
title: 'Updating Account',
|
||||
subtitle:
|
||||
'We\'ve successfully collected your funds. We are now '
|
||||
'updating your billing account. This won\'t take long.',
|
||||
status: controller.model.status,
|
||||
isLoading: controller.model.isLoading,
|
||||
errorMessage: 'We failed to update your billing account',
|
||||
onRetry: () {
|
||||
controller.doIntegration();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user