credit_card_input_form 1.2.0 credit_card_input_form: ^1.2.0 copied to clipboard
This package provides visually beautiful UX through animation of credit card information input form.
import 'package:flutter/material.dart';
import 'package:credit_card_input_form/credit_card_input_form.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
// translate and customize captions
final Map<String, String> customCaptions = {
'PREV': 'Prev',
'NEXT': 'Next',
'DONE': 'Done',
'CARD_NUMBER': 'Card Number',
'CARDHOLDER_NAME': 'Cardholder Name',
'VALID_THRU': 'Valid Thru',
'SECURITY_CODE_CVC': 'Security Code (CVC)',
'NAME_SURNAME': 'Name Surname',
'MM_YY': 'MM/YY',
'RESET': 'Reset',
};
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
// color: currentColor,
child: Stack(children: [
CreditCardInputForm(
showResetButton: true,
onStateChange: (currentState, cardInfo) {
print(currentState);
print(cardInfo);
},
customCaptions: customCaptions,
),
]),
),
),
),
);
}
}