auth_code_textfield 2.0.7 copy "auth_code_textfield: ^2.0.7" to clipboard
auth_code_textfield: ^2.0.7 copied to clipboard

A custom auth code textfield widget.

flutter_auth_code_textfield #

A custom auth code textfield widget.

一个Flutter自定义的验证码Widget,纯Flutter代码,支持安卓,iOS.

Useage #

Mode: singleItem , like Keep

Item模式,如Keep的风格。

AuthCodeTextfield(
                  mode: AuthCodeMode.singleItem,
                  itemWidth: 50,
                  itemHeight: 50,
                  itemSpacing: 35 * scaleWidth,
                  itemBackgroundColor: Color.fromRGBO(120, 114, 127, 1),
                  textColor: Colors.white,
                  cursorColor: Color.fromRGBO(94,178,138,1),
                  onChanged: (s) {
                    setState(() {
                      _inputText = s;
                    });
                  },
                ),
iOS Android

Mode: bottomLine , like DingDing

bottomLine模式,如钉钉的风格。

AuthCodeTextfield(
                  mode: AuthCodeMode.bottomLine,
                  itemWidth: 50,
                  itemHeight: 60,
                  itemSpacing: 35 * scaleWidth,
                  itemBottomLineColor: Color.fromRGBO(229, 231, 233, 1),
                  cursorWidth: 1,
                  cursorHeight: 30,
                  onChanged: (s) {
                    _inputText = s;
                    if (s.toString().length >= 4 && widget.onSubmited != null) {
                      widget.onSubmited(_inputText);
                      Navigator.pop(context);
                    }
                  },
                ),
iOS Android

Getting Started #

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

dependencies: auth_code_textfield: ^0.0.2

If you want to support flutter 2.0 null safety please:

dependencies: auth_code_textfield: ^2.0.0

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

2
likes
100
pub points
44%
popularity

Publisher

unverified uploader

A custom auth code textfield widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on auth_code_textfield