credit_card_displayer 0.0.6 credit_card_displayer: ^0.0.6 copied to clipboard
A very easy-to-use package to display credit card with the appropriate logo, according to the credit card first number
import 'package:credit_card_displayer/credit_card_displayer.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Credit Card Displayer',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Credit Card Displayer Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CreditCardDisplayer(
cardNumber: '3111111111111111',
expiryDate: '12/24',
cardHolder: 'John Doe',
width: 300,
height: 200,
backgroundColor: Colors.blue,
textColor: Colors.white,
),
],
),
),
);
}
}