credit_card_detector 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

credit_card_detector #

pub package

A dart package to display a horizontal bar of customisable toggle tabs. Supports iOS and Android.

Installation #

Depend on it.

dependencies:
  credit_card_detector: ^1.0.0

Usage #

import 'package:credit_card_detector/credit_card_detector.dart';

CreditCardWidget(
  cardNumber: '4040 4040 4040 4040',
  expiryDate: '11/11',
  cardHolderName: 'Noctis Lucis Caelum',
  cvvCode: '1234',
  showBackView: false,
)

Parameters #

@required final String cardNumber;
@required final String expiryDate;
@required final String cardHolderName;
@required final String cvvCode;
final TextStyle textStyle;
final Color cardBgColor;
final bool showBackView;
final Duration animationDuration;
final double height;
final double width;

0.0.1 #

  • Initial release.

1.0.0 #

  • Add README, CHANGELOG, LICENSE
  • Release 1.0.0

1.0.1 #

  • Update CHANGELOG
  • Release 1.0.1

1.0.2 #

  • Flutter format

example/lib/main.dart

import 'package:credit_card_detector_example/example01.dart';
import 'package:credit_card_detector_example/example02.dart';
import 'package:credit_card_detector_example/example03.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String cardNumber = '';
  String expiryDate = '';
  String cardHolderName = '';
  String cvvCode = '';
  bool isCvvFocused = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: DefaultTabController(
          length: 3,
          child: Scaffold(
            appBar: AppBar(
              bottom: TabBar(
                tabs: [
                  Tab(text: 'Example 01'),
                  Tab(text: 'Example 02'),
                  Tab(text: 'Example 03'),
                ],
              ),
              title: const Text('Flutter Credit Card'),
            ),
            body: TabBarView(
              children: [
                Example01(),
                Example02(),
                Example03(),
              ],
            ),
          ),
        ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  credit_card_detector: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:credit_card_detector/credit_card_detector.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Jun 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Health suggestions

Fix lib/credit_card_widget.dart. (-1 points)

Analysis of lib/credit_card_widget.dart reported 2 hints:

line 152 col 68: 'title' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline6. This feature was deprecated after v1.13.8..

line 248 col 68: 'title' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline6. This feature was deprecated after v1.13.8..

Format lib/detector/card_detector.dart.

Run flutter format to format lib/detector/card_detector.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test