Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentavosInputFormatter problema inserir valores #57

Closed
greboone opened this issue Feb 4, 2022 · 3 comments
Closed

CentavosInputFormatter problema inserir valores #57

greboone opened this issue Feb 4, 2022 · 3 comments

Comments

@greboone
Copy link

greboone commented Feb 4, 2022

No formatador de centavos, utilizado da forma mostrada abaixo, obtive o seguinte problema:

  • Ao começar a digitar no campo com o valor 9, e somente 9, o formatador coloca o digito no local errado da string não deixando o usuário apagar o que foi inserido. Só é possível apagar após inserir outro dígito, sendo ele qualquer outro valor.
    Gif demonstrando o problema
TextFormField(
  focusNode: _quantityFN, 
  autocorrect: false,
  decoration: InputDecoration(labelText: 'Quantidade'),
  keyboardType: TextInputType.number,
  controller: _quantity,
  inputFormatters: [
    FilteringTextInputFormatter.digitsOnly,
    CentavosInputFormatter(),
  ],
  onChanged: (value) {
    print(value);
  }
),
@greboone
Copy link
Author

greboone commented Feb 4, 2022

Com testes rápidos, alterando na linha 68 a lógica para if (numero > 0 && numero <= 9) funciona perfeitamente

@rubensdemelo
Copy link
Collaborator

@greboone vou corrigir este final de semana

@rubensdemelo
Copy link
Collaborator

corrigido na versao 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants