pakdatakit_flutter library

Flutter widgets for Pakistani data, built on package:pakdatakit:

import 'package:pakdatakit_flutter/pakdatakit_flutter.dart';

CnicField(decoration: const InputDecoration(labelText: 'CNIC'));
RaastQr(iban: 'PK36SCBL0000001123456702');

InputState, CNICInfo, PhoneAnalysis and BankInfo are re-exported from package:pakdatakit; import that package for everything else.

Classes

BankInfo
A bank (or other institution) that issues Pakistani IBANs.
CnicField
A TextFormField for a CNIC that formats as you type (35202-1234567-1), shows the number keyboard and validates it.
CNICInfo
Information encoded in a CNIC number. See getCNICInfo.
CnicInputFormatter
Formats a CNIC as the user types: 35202-1234567-1.
IbanField
A TextFormField for a Pakistani IBAN that formats as you type (PK36 SCBL 0000 0011 2345 6702), uppercases letters and validates it, including the checksum.
IbanInputFormatter
Formats a Pakistani IBAN as the user types: uppercase, in groups of four (PK36 SCBL 0000 0011 2345 6702), up to 24 characters.
PakTextFormField<Info>
Common base of CnicField, PhoneField and IbanField: a TextFormField that formats as you type and validates with package:pakdatakit.
PakValidators
Validators for FormField.validator, e.g. on a TextFormField.
PhoneAnalysis
Combined phone validation, formatting and network analysis result. See analyzePhone.
PhoneField
A TextFormField for a Pakistani mobile number that formats as you type (0300-1234567 or +92 300 1234567), shows the phone keyboard, offers phone number autofill and validates it.
PhoneInputFormatter
Formats a Pakistani mobile number as the user types: 0300-1234567, or +92 300 1234567 when the user starts with the country code.
RaastQr
Shows a Raast person-to-person payment QR code for an IBAN, which banking apps such as Easypaisa and JazzCash can scan.

Enums

InputState
State of a form field while the user is typing.
RaastQrErrorCorrection
QR error correction level: how much of the code can be damaged or covered and still scan. Higher levels make denser codes.

Typedefs

PakInputStateCallback<Info> = void Function(InputState state, Info? info)
Called when the InputState of a field changes, and when a valid value changes. info holds details about the value while it is valid (it can still be null then, e.g. an IBAN of a bank missing from the dataset).
RaastQrErrorBuilder = Widget Function(BuildContext context, Object error)
Builds the widget shown when the QR payload cannot be created, e.g. because the IBAN is invalid. error is the ArgumentError thrown by createRaastP2PQr.