Pin Code Fields In Flutter

A Flutter Package To Create Pin Code Fields In Your Flutter Apps

Naveen Srivastava
FlutterDevs

--

Flutter is Google’s UI tool stash for making excellent, natively compiled iOS and Android applications from a single code base. To construct any application, we start with widgets — The building square of flutter applications. Widgets portray what their view ought to resemble given their present design and state. It incorporates a text widget, row widget, column widget, container widget, and some more.

In this article, we will explore the Pin Code Fileds in flutter using the flutter_pin_code_fields_package. With the help of the package, we can easily achieve flutter pin code fields. So let’s get started.

Table Of Contents :

Flutter

Pin Code Fileds

Attributes

Implementation

Code Implement

Code File

Conclusion

Flutter :

“ Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time, Flutter offers great developer tools, with amazing hot reload”

Pin Code Fields :

The flutter pin code Fields library helps us to create a customizable field, we use it for any login pin or OTP. In this library, we can make the input text of animated type.

Demo Module :

Attributes:

Some Basic Attributes:

  • > length: We use the length property to define the total pin code field.
  • > fieldHeight: We use the field height property to reduce and increase the height of the field.
  • > fieldWidth: We use the field width property to reduce and increase the width of the field.
  • > obscureText: Use the obscure text property to hide the user’s input text.
  • > margin: The margin property provides margin between fields.
  • > padding: The padding property provides padding between fields.

Implementation :

You need to implement it in your code respectively :

Step 1: Add dependencies.

Add dependencies to pubspec — yaml file.

dependencies:   
flutter_pin_code_fields: ^1.1.0

Step 2: import the package :

import 'package:flutter_pin_code_fields/flutter_pin_code_fields.dart';

Step 3: Run flutter package get

How to implement code in dart file :

Create a new dart file called pin_code_filed_demo.dart inside the libfolder.

Note: You can read the full blog here.

--

--