|
|
|
@ -9,7 +9,9 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
|
|
|
|
|
class PaymentMethod extends StatefulWidget {
|
|
|
|
|
Function onSelectedMethod;
|
|
|
|
|
|
|
|
|
|
PaymentMethod({this.onSelectedMethod});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_PaymentMethodState createState() => _PaymentMethodState();
|
|
|
|
|
}
|
|
|
|
@ -56,13 +58,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 60.0,
|
|
|
|
|
width:60,
|
|
|
|
|
width: 60,
|
|
|
|
|
padding: EdgeInsets.all(7.0),
|
|
|
|
|
child: Image.asset("assets/images/new-design/mada.png"),
|
|
|
|
|
),
|
|
|
|
|
mWidth(12),
|
|
|
|
|
Text(
|
|
|
|
|
"MADA",
|
|
|
|
|
"Mada",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 14,
|
|
|
|
@ -96,7 +98,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
width: 60,
|
|
|
|
|
child: Image.asset("assets/images/new-design/visa.png"),
|
|
|
|
|
),
|
|
|
|
|
mWidth(12),Text(
|
|
|
|
|
mWidth(12),
|
|
|
|
|
Text(
|
|
|
|
|
"VISA",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
@ -133,7 +136,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
),
|
|
|
|
|
mWidth(12),
|
|
|
|
|
Text(
|
|
|
|
|
"MASTER CARD",
|
|
|
|
|
"MasterCard",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 14,
|
|
|
|
@ -169,7 +172,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
),
|
|
|
|
|
mWidth(12),
|
|
|
|
|
Text(
|
|
|
|
|
"INSTALLMENT",
|
|
|
|
|
"Installments",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 14,
|
|
|
|
@ -183,39 +186,75 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
),
|
|
|
|
|
Platform.isIOS
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 25.0),
|
|
|
|
|
child: Flex(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
updateSelectedPaymentMethod("ApplePay");
|
|
|
|
|
},
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 3.0,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 120.0,
|
|
|
|
|
padding: EdgeInsets.all(20.0),
|
|
|
|
|
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
updateSelectedPaymentMethod("ApplePay");
|
|
|
|
|
},
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 3.0,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 60.0,
|
|
|
|
|
padding: EdgeInsets.all(7.0),
|
|
|
|
|
width: 60,
|
|
|
|
|
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
|
|
|
|
|
),
|
|
|
|
|
mWidth(12),
|
|
|
|
|
Text(
|
|
|
|
|
"Apple Pay",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 25.0),
|
|
|
|
|
// child: Flex(
|
|
|
|
|
// direction: Axis.horizontal,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Container(
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// updateSelectedPaymentMethod("ApplePay");
|
|
|
|
|
// },
|
|
|
|
|
// child: Card(
|
|
|
|
|
// elevation: 3.0,
|
|
|
|
|
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// shape: RoundedRectangleBorder(
|
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
|
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
|
|
|
|
|
// ),
|
|
|
|
|
// child: Container(
|
|
|
|
|
// height: 120.0,
|
|
|
|
|
// padding: EdgeInsets.all(20.0),
|
|
|
|
|
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Container(),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
: Container(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 150.0,
|
|
|
|
@ -264,7 +303,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
|
|
|
|
|
updateSelectedPaymentMethod(String selectedMethod) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedPaymentMethod = selectedMethod;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|