viewMakePay method
dynamic
viewMakePay(
- dynamic context
Implementation
viewMakePay(context) {
Size size = MediaQuery.of(context).size;
dynamic headers = {
"public_key": widget.public_key,
"private_key": widget.private_key,
"secret_key": widget.secret_key,
"merchant_key": widget.merchant_key,
"required_user_information": widget.required_user_information,
"custom_user_information": widget.custom_user_information,
};
return SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: size.width,
padding: EdgeInsets.all(15),
color: ColorConstant.black,
child: Text(
"${taux} % de frais appliqués",
style: TextStyle(
color: Colors.white,
fontSize: 15,
),
textAlign: TextAlign.center,
),
),
transaction_object != null
? Container(
width: size.width,
height: size.height * 0.3,
child: Stack(
children: [
Container(
width: size.width,
height: size.height * 0.2,
color: ColorConstant.fromHex(widget.color),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Montant à payer",
style: TextStyle(
color: ColorConstant.white, fontSize: 20),
),
Text(
"${total_with_fees} ${transaction_object["x_currency"]["_code_alpha"]}",
style: TextStyle(
color: ColorConstant.white,
fontSize: 20,
fontWeight: FontWeight.bold),
),
],
),
),
Positioned(
bottom: size.height * 0.01,
child: Container(
width: size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: size.width * 0.3,
height: size.width * 0.3,
decoration: BoxDecoration(
border: Border.all(
color: ColorConstant.white,
width: 10),
borderRadius: BorderRadius.all(
Radius.circular(60))),
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
color: ColorConstant.fromHex(
widget.color),
width: 10),
borderRadius: BorderRadius.all(
Radius.circular(60))),
child: Image.network(
transaction_object["_store"]["logo_url"],
fit: BoxFit.contain,
),
),
)
],
),
))
],
),
)
: SizedBox(),
Container(
width: size.width,
height: size.height * 0.6,
child: DefaultTabController(
length: 1,
child: Scaffold(
backgroundColor: ColorConstant.white,
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: ColorConstant.white,
title: TabBar(
indicatorColor: ColorConstant.fromHex(widget.color),
dividerColor: ColorConstant.fromHex(widget.color),
labelColor: ColorConstant.fromHex(widget.color),
onTap: (value) {
switch (value) {
case 0:
setState(() {
type_means_of_paiement = TYPE_MEANS_PAYMENT_MOBILE;
});
break;
case 1:
setState(() {
type_means_of_paiement = TYPE_MEANS_PAYMENT_BANK;
});
break;
}
loadAmount();
},
tabs: [
Tab(
icon: Icon(Icons.mobile_friendly),
text: "Mobile Money",
),
/* Tab(
icon: Icon(Icons.credit_card),
text: "Carte Bancaire"),*/
],
),
),
body: TabBarView(
children: [
PaymentMobileScreen(
headers,
transaction_result,
mobile_means_of_paiements,
total_to_pay,
total_with_fees,
fees,
taux,
selected_means_of_paiement, (value) {
setState(() {
page = value;
});
}, widget.color),
/*
PaymentCardScreen(),
*/
],
),
),
),
),
],
),
);
}