inputDecimalFormatter static method

List<TextInputFormatter> inputDecimalFormatter()

chỉ có phép nhập số, dấu thập phân và format thành phần ngàn

Implementation

static List<TextInputFormatter> inputDecimalFormatter() {
  var inputFormatters = [
    FilteringTextInputFormatter.allow(RegExp(r'^[0-9,]*$')),

    //* comment lại do nhập thập phân số 0 nó sẽ làm tròn, vd: 2585,004 => nó sẽ round thành 2585, không nhập được 2585,004
    // ThousandsFormatter(allowFraction: true),
  ];
  return inputFormatters;
}