pin_code_text_field 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 70

pin_code_text_field

It's a Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

Star 🌟 to show support!

pin usage pin usage

Getting Started

For help getting started with Flutter, view our online documentation.

[0.0.2] - 16 October 2018

  • First release of plugin

[0.1.3] - 16 October 2018

  • Update with customizable BoxDecorator

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pin_code_text_field/pin_code_text_field.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {

  @override
  State<StatefulWidget> createState() {
    return MyHomePageState();
  }

}

class MyHomePageState extends State<MyHomePage> {
  TextEditingController controller = TextEditingController();
  String thisText = "234235";
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("TEXT"),
      ),
      body: Center(
        child: Container(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              PinCodeTextField(controller: controller, hideCharacter: true, highlight: true, highlightColor: Colors.blue, maxLength: 5, defaultBorderColor: Colors.black,),
              RaisedButton(onPressed: (){
                setState(() {
                  this.thisText = controller.text;
                });
              }),
              Text(thisText)
            ],
          ),
        ),
      ),
    );
  }

}

Use this package as a library

1. Depend on it

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


dependencies:
  pin_code_text_field: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:pin_code_text_field/pin_code_text_field.dart';
  
Version Uploaded Documentation Archive
0.1.3 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.1.3 Download pin_code_text_field 0.1.3 archive
0.1.2 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.1.2 Download pin_code_text_field 0.1.2 archive
0.1.1 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.1.1 Download pin_code_text_field 0.1.1 archive
0.1.0 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.1.0 Download pin_code_text_field 0.1.0 archive
0.0.3 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.0.3 Download pin_code_text_field 0.0.3 archive
0.0.2 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.0.2 Download pin_code_text_field 0.0.2 archive
0.0.1 Oct 16, 2018 Go to the documentation of pin_code_text_field 0.0.1 Download pin_code_text_field 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test