buildBackCard method
Implementation
Widget buildBackCard() {
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
elevation: 8,
child: Container(
height: 200,
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0),
gradient: const LinearGradient(
colors: [Color(0xFFC69C6D), Color(0xFF9E7B4F)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 12,
spreadRadius: 3,
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 40,
color: Colors.black,
margin: const EdgeInsets.only(bottom: 20),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: TextField(
controller: controller.cvvController,
maxLength: 3,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
counterText: "",
hintText: 'CVV',
hintStyle: TextStyle(color: Colors.black54),
fillColor: Colors.white,
filled: true,
border: InputBorder.none,
),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black),
),
),
const SizedBox(width: 16),
GetBuilder<BankCardController>(
builder: (controller) => Text(
'Expiry: ${controller.expiryDate.isNotEmpty ? controller.expiryDate : 'MM/YY'}',
style: const TextStyle(fontSize: 16, color: Colors.white),
),
),
],
),
const Spacer(),
GetBuilder<BankCardController>(
builder: (controller) => Align(
alignment: Alignment.bottomRight,
child: Text(
'**** **** **** ${controller.cardNumber.isNotEmpty ? controller.cardNumber.substring(controller.cardNumber.value.length - 4) : '5678'}',
style: const TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold),
textDirection: TextDirection.ltr,
),
),
),
],
),
),
);
}