You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/pages/ToDoList/payment_method_select.dart

245 lines
10 KiB
Dart

import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
4 years ago
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget {
@override
_PaymentMethodState createState() => _PaymentMethodState();
}
class _PaymentMethodState extends State<PaymentMethod> {
4 years ago
String selectedPaymentMethod = "MADA";
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView(
child: Container(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center,
child: Text("Select Payment Method",
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
4 years ago
updateSelectedPaymentMethod("MADA");
},
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),
4 years ago
side: selectedPaymentMethod == "MADA"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/mada.png"),
),
),
),
),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
4 years ago
updateSelectedPaymentMethod("VISA");
},
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),
4 years ago
side: selectedPaymentMethod == "VISA"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
4 years ago
"assets/images/new-design/visa.png"),
),
),
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
4 years ago
updateSelectedPaymentMethod("MASTERCARD");
},
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),
4 years ago
side: selectedPaymentMethod == "MASTERCARD"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/mastercard.png"),
),
),
),
),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
4 years ago
updateSelectedPaymentMethod("Installment");
},
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),
4 years ago
side: selectedPaymentMethod == "Installment"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/installment.png"),
),
),
),
),
),
],
),
),
4 years ago
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
4 years ago
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(),
),
],
4 years ago
),
),
4 years ago
SizedBox(
height: 150.0,
),
],
),
),
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
4 years ago
minWidth: MediaQuery.of(context).size.height * 0.1,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
4 years ago
Navigator.pop(context, selectedPaymentMethod);
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
updateSelectedPaymentMethod(String selectedMethod) {
setState(() {
selectedPaymentMethod = selectedMethod;
});
}
}