indzcreditcard 0.1.8
indzcreditcard: ^0.1.8 copied to clipboard

Flutter Android iOS web

A Credit Card widget package, support entering card details, card flip animation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:indzcreditcard/indzcreditcard_form.dart';
import 'package:indzcreditcard/indzcreditcard_model.dart';
import 'package:indzcreditcard/indzcreditcard.dart';

void main() => runApp(MySample());

class MySample extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return MySampleState();
  }
}

class MySampleState extends State<MySample> {
  String cardNumber = '';
  String expiryDate = '';
  String cardHolderName = '';
  String cvvCode = '';
  String cPass1 = '';
  String cPass2 = '';
  bool isCvvFocused = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Indzooom Credit Card View Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: Scaffold(
        resizeToAvoidBottomInset: true,
        body: SafeArea(
          child: Column(
            children: <Widget>[
              CreditCardWidget(
                height: 210,
                cardNumber: cardNumber,
                expiryDate: expiryDate,
                cardHolderName: cardHolderName,
                cvvCode: cvvCode,
                cPass1: cPass1,
                cPass2: cPass2,
                showBackView: isCvvFocused,
                backTextStyle: TextStyle(color: Colors.black, fontSize: 18),
                textStyle: TextStyle(color: Colors.black, fontSize: 18, fontFamily: 'halter'),
              ),
              Expanded(
                child: SingleChildScrollView(
                  child: CreditCardForm(
                    onCreditCardModelChange: onCreditCardModelChange,
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }

  void onCreditCardModelChange(CreditCardModel creditCardModel) {
    setState(() {
      cardNumber = creditCardModel.cardNumber;
      expiryDate = creditCardModel.expiryDate;
      cardHolderName = creditCardModel.cardHolderName;
      cvvCode = creditCardModel.cvvCode;
      isCvvFocused = creditCardModel.isCvvFocused;
    });
  }
}
0
likes
80
pub points
26%
popularity

A Credit Card widget package, support entering card details, card flip animation.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

giulianojordao@gmail.com

License

BSD (LICENSE)

Dependencies

flutter

More

Packages that depend on indzcreditcard