credit card stuff

This commit is contained in:
2023-02-26 01:06:13 -05:00
parent 482f24bf92
commit 6c71586d57

View File

@@ -18,7 +18,7 @@ class CreditViewState extends State<CreditView> {
String cardHolderName = ''; String cardHolderName = '';
String cvvCode = ''; String cvvCode = '';
bool isCvvFocused = false; bool isCvvFocused = false;
bool useGlassMorphism = false; bool useGlassMorphism = true;
bool useBackgroundImage = false; bool useBackgroundImage = false;
OutlineInputBorder? border; OutlineInputBorder? border;
final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>();
@@ -46,10 +46,6 @@ class CreditViewState extends State<CreditView> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Container( body: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage(
image: ExactAssetImage('assets/bg.png'),
fit: BoxFit.fill,
),
color: Colors.black, color: Colors.black,
), ),
child: SafeArea( child: SafeArea(
@@ -59,27 +55,21 @@ class CreditViewState extends State<CreditView> {
height: 30, height: 30,
), ),
CreditCardWidget( CreditCardWidget(
glassmorphismConfig: glassmorphismConfig: useGlassMorphism ? Glassmorphism.defaultConfig() : null,
useGlassMorphism ? Glassmorphism.defaultConfig() : null,
cardNumber: cardNumber, cardNumber: cardNumber,
expiryDate: expiryDate, expiryDate: expiryDate,
cardHolderName: cardHolderName, cardHolderName: cardHolderName,
cvvCode: cvvCode, cvvCode: cvvCode,
bankName: 'Axis Bank', bankName: 'Axis Bank',
frontCardBorder: frontCardBorder: !useGlassMorphism ? Border.all(color: Colors.grey) : null,
!useGlassMorphism ? Border.all(color: Colors.grey) : null, backCardBorder: !useGlassMorphism ? Border.all(color: Colors.grey) : null,
backCardBorder:
!useGlassMorphism ? Border.all(color: Colors.grey) : null,
showBackView: isCvvFocused, showBackView: isCvvFocused,
obscureCardNumber: true, obscureCardNumber: true,
obscureCardCvv: true, obscureCardCvv: true,
isHolderNameVisible: true, isHolderNameVisible: true,
backgroundImage: useBackgroundImage ? 'assets/card_bg.png' : null,
backgroundImage:
useBackgroundImage ? 'assets/card_bg.png' : null,
isSwipeGestureEnabled: true, isSwipeGestureEnabled: true,
onCreditCardWidgetChange: onCreditCardWidgetChange: (CreditCardBrand creditCardBrand) {},
(CreditCardBrand creditCardBrand) {},
customCardTypeIcons: <CustomCardTypeIcon>[ customCardTypeIcons: <CustomCardTypeIcon>[
CustomCardTypeIcon( CustomCardTypeIcon(
cardType: CardType.mastercard, cardType: CardType.mastercard,
@@ -144,65 +134,10 @@ class CreditViewState extends State<CreditView> {
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Glassmorphism',
style: TextStyle(
color: Colors.white,
fontSize: 18,
),
),
const Spacer(),
Switch(
value: useGlassMorphism,
inactiveTrackColor: Colors.grey,
activeColor: Colors.white,
onChanged: (bool value) => setState(() {
useGlassMorphism = value;
}),
),
],
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Card Image',
style: TextStyle(
color: Colors.white,
fontSize: 18,
),
),
const Spacer(),
Switch(
value: useBackgroundImage,
inactiveTrackColor: Colors.grey,
activeColor: Colors.white,
onChanged: (bool value) => setState(() {
useBackgroundImage = value;
}),
),
],
),
),
const SizedBox(
height: 20,
),
GestureDetector( GestureDetector(
onTap: _onValidate, onTap: _onValidate,
child: Container( child: Container(
margin: const EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 15), padding: const EdgeInsets.symmetric(vertical: 15),
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
@@ -217,14 +152,13 @@ class CreditViewState extends State<CreditView> {
), ),
), ),
), ),
OutlinedButton( ElevatedButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
foregroundColor: MaterialStateProperty.all<Color>(Colors.red), ),
), onPressed: () {},
onPressed: () { }, child: Text('Complete Setup'),
child: Text('Complete Setup'), ),
),
], ],
), ),
), ),
@@ -234,7 +168,6 @@ class CreditViewState extends State<CreditView> {
), ),
), ),
), ),
); );
} }