PWEditField constructor

PWEditField({
  1. @required int? textFieldCount,
  2. double textFieldWidth = 30,
  3. double textFieldHeight = 30,
  4. double textFieldSpace = 3,
  5. bool autoFocus = false,
  6. bool obscureText = true,
  7. bool isDoneClean = false,
  8. TextStyle textStyle = const TextStyle(fontSize: 12, color: Colors.black54, decoration: TextDecoration.none),
  9. TextInputType keyboardType = TextInputType.number,
  10. List<TextInputFormatter>? inputFormatters,
  11. BoxDecoration? focusDecoration,
  12. BoxDecoration? unFocusDecoration,
  13. ValueChanged<String>? onInputDone,
  14. ValueChanged<String>? onChanged,
  15. TextEditingController? controller,
  16. Key? key,
})

只能输入数字 Only numbers can be entered inputFormatters = [WhitelistingTextInputFormatter(RegExp("0-9")),]

Implementation

PWEditField({
  @required this.textFieldCount,
  this.textFieldWidth = 30,
  this.textFieldHeight = 30,
  this.textFieldSpace = 3,
  this.autoFocus = false,
  this.obscureText = true,
  this.isDoneClean = false,
  this.textStyle = const TextStyle(
    fontSize: 12,
    color: Colors.black54,
    decoration: TextDecoration.none,
  ),
  this.keyboardType = TextInputType.number,
  this.inputFormatters,
  this.focusDecoration,
  this.unFocusDecoration,
  this.onInputDone,
  this.onChanged,
  this.controller,
  Key? key,
}) : super(
        key: key,
      ) {
  this.controller ??= TextEditingController();
  this.focusDecoration ??=
      BoxDecoration(
        border: Border.all(color: Colors.blue, width: 1),
        borderRadius: BorderRadius.all(Radius.circular(2)),
      );
  this.unFocusDecoration ??=
      BoxDecoration(
        border: Border.all(color: Colors.grey, width: 1),
        borderRadius: BorderRadius.all(Radius.circular(2)),
      );
}