pk_cnic_input_field 1.0.0 copy "pk_cnic_input_field: ^1.0.0" to clipboard
pk_cnic_input_field: ^1.0.0 copied to clipboard

Takes input in the Pakistani CNIC format

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PK CNIC Input Field Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: const MyHomePage(title: 'PK CNIC Input Field Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({required this.title, Key? key}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String cnic = "";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: [
            PKCNICInputField(
              onChanged: (value) {
                cnic = value;
                setState(() {});
              },
            ),
            const SizedBox(
              height: 10,
            ),
            Text("Your CNIC is " + cnic),
          ],
        ),
      ),
    );
  }
}
4
likes
140
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

Takes input in the Pakistani CNIC format

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on pk_cnic_input_field