View Cards static page
This commit is contained in:
164
lib/features/card/screens/card_details_screen.dart
Normal file
164
lib/features/card/screens/card_details_screen.dart
Normal file
@@ -0,0 +1,164 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CardDetailsScreen extends StatelessWidget {
|
||||
const CardDetailsScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("My Cards"),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ListView(
|
||||
children: const [
|
||||
CardTile(
|
||||
cardNumber: "**** **** **** 1234",
|
||||
cardNetwork: "VISA",
|
||||
cardType: "Debit Card",
|
||||
validFrom: "01/22",
|
||||
validTo: "01/27",
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
CardTile(
|
||||
cardNumber: "**** **** **** 5678",
|
||||
cardNetwork: "Mastercard",
|
||||
cardType: "Debit Card",
|
||||
validFrom: "07/21",
|
||||
validTo: "07/26",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CardTile extends StatelessWidget {
|
||||
final String cardNumber;
|
||||
final String cardNetwork;
|
||||
final String cardType;
|
||||
final String validFrom;
|
||||
final String validTo;
|
||||
|
||||
const CardTile({
|
||||
super.key,
|
||||
required this.cardNumber,
|
||||
required this.cardNetwork,
|
||||
required this.cardType,
|
||||
required this.validFrom,
|
||||
required this.validTo,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Colors.blue, Colors.indigo],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
blurRadius: 8,
|
||||
spreadRadius: 2,
|
||||
offset: Offset(2, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Top row: Logo + Bank name
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
const Text(
|
||||
"Kangra Central Co-operative Bank",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Card number (masked)
|
||||
Text(
|
||||
cardNumber,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 22,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Validity
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text("VALID FROM",
|
||||
style: TextStyle(color: Colors.white70, fontSize: 10)),
|
||||
Text(
|
||||
validFrom,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text("VALID UPTO",
|
||||
style: TextStyle(color: Colors.white70, fontSize: 10)),
|
||||
Text(
|
||||
validTo,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
cardNetwork,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
cardType,
|
||||
style: const TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:kmobile/features/card/screens/block_card_screen.dart';
|
||||
import 'package:kmobile/features/card/screens/card_details_screen.dart';
|
||||
import 'package:kmobile/features/card/screens/card_pin_change_details_screen.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
@@ -74,12 +75,26 @@ class _CardManagementScreen extends State<CardManagementScreen> {
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
CardManagementTile(
|
||||
icon: Symbols.payment_card,
|
||||
label: AppLocalizations.of(context).viewCardDeatils,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const CardDetailsScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class CardManagementTile extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String label;
|
||||
|
@@ -289,5 +289,6 @@
|
||||
"deleteBeneficiary": "Delete Beneficiary",
|
||||
"beneficiarydetails": "Beneficiary Details",
|
||||
"delete": "Delete",
|
||||
"search": "Search"
|
||||
"search": "Search",
|
||||
"viewCardDeatils": "View Card Details"
|
||||
}
|
||||
|
@@ -289,5 +289,6 @@
|
||||
"deleteBeneficiary": "लाभार्थी हटाएं",
|
||||
"beneficiarydetails": "लाभार्थी विवरण",
|
||||
"delete": "मिटाओ",
|
||||
"search": "खोजें"
|
||||
"search": "खोजें",
|
||||
"viewCardDeatils": "कार्ड विवरण देखें"
|
||||
}
|
||||
|
Reference in New Issue
Block a user