pinput 0.1.2 copy "pinput: ^0.1.2" to clipboard
pinput: ^0.1.2 copied to clipboard

outdated

100% Dart based PIN input field widget for Flutter, this widget accepts string os any length and calls the onSubmit method when all fields are filled.

example/lib/main.dart

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

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

class PinPutTest extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(primaryColor: Colors.green, hintColor: Colors.green),
        home: Scaffold(
            body: Builder(
          builder: (context) => Padding(
                padding: const EdgeInsets.all(40.0),
                child: Center(
                  child: PinPut(
                    onSubmit: (String pin) => _showSnackBar(pin, context),
                  ),
                ),
              ),
        )));
  }

  void _showSnackBar(String pin, BuildContext context) {
    final snackBar = SnackBar(
      duration: Duration(seconds: 5),
      content: Container(
          height: 80.0,
          child: Center(
            child: Text(
              'Pin Submitted. Value: $pin',
              style: TextStyle(fontSize: 25.0),
            ),
          )),
      backgroundColor: Colors.greenAccent,
    );
    Scaffold.of(context).showSnackBar(snackBar);
  }
}
2506
likes
0
pub points
99%
popularity

Publisher

verified publisherfman.ge

100% Dart based PIN input field widget for Flutter, this widget accepts string os any length and calls the onSubmit method when all fields are filled.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pinput