danilocoppi / flutter-textfield-mask Goto Github PK
View Code? Open in Web Editor NEWEasy TextField Mask to be applied as TextInputMask
License: Apache License 2.0
Easy TextField Mask to be applied as TextInputMask
License: Apache License 2.0
In case the image did not come through...
On my Android. Your PUB.DEV currency example produces:
$0,022.22 type of final format. And does not let you back over all the digits to start from scratch.
I believe that one of the desired behaviors would be to start the cursor at the left. I turned off reverse and then it doesn't recognize the decimal input.
Maybe not a bug... But the Example should at very least be of a real life currency display. Such as $22.22
input double values when typing. The issue was on some keyboards. ( latest keyboard in MI / ONE PLUS or custom keyboard - sample custom keyboard app)
Code
final maskFormatter = TextInputMask(mask: 'AAAAA-9999-A');
TextFormField(
inputFormatters: [maskFormatter]
),
mask.clearMask(text) throws error;
String text = '432516565';
MagicMask mask = MagicMask.buildMask('\\+99 (99) 99999-9999');
String formattedString = mask.clearMask(text);
═══════ Exception caught by gesture ═══════════════════════════════════════════
The following LateError was thrown while handling a gesture:
LateInitializationError: Field '_reverse@1636313728' has not been initialized.
When the exception was thrown, this was the stack
#0 MagicMask._reverse (package:easy_mask/src/magic_mask.dart)
#1 MagicMask.clearMask (package:easy_mask/src/magic_mask.dart:203:20)
How to permit positive and negative numbers ?
like:
1.234,56
-1.234,56
Por exemplo... se eu tenho uma mascara de cpf, ficará assim: 222.222.222-22
São 11 números 2. Se eu apertei mais umas 5 vezes, serão 16. A mascara fica ok mas ao apagar, nada muda.
Teria que apertar o apagar as 5 vezes até chegar ao último caractere da mascara e ai sim começar a apagar.
import 'package:easy_mask/easy_mask.dart';
There are few places the import section has been written as
import package:easy_mask/text_input_mask.dart
But it would be easier to copy and paste this section like
import 'package:easy_mask/easy_mask.dart';
TextInputMask
are missing parenthesis on code-snippetI tried to type 20.00 and it didn't work
Is there a way to set the text without need to type it like the textController.text = value?
I've got the following error on package:easy_mask/src/magic_mask.dart
LateInitializationError: Field '_overflow@1678313728' has not been initialized.
Stacktrace:
MagicMask._buildResultJson\npackage:easy_mask/src/magic_mask.dart 159:14
MagicMask._overflow\npackage:easy_mask/src/magic_mask.dart 354:19
Vou escrever em português mesmo, já que vi que são brasileiros.
To tentando usar o magickMask
(que apropósito acho que seria magic, sem o k, não? O getAdvancedMaskedStrign
ta escrito errado tb rs Strign ao invés de String).
Já tentei de tudo, mas não funciona.
final magicMask = TextInputMask(
mask: '9+.999.999,99',
placeholder: '0',
maxPlaceHolders: 3,
reverse: true,
maxLength: 14,
).magickMask();
magicMask.getMaskedString('10500'); // Retorna os mesmos 10500 sem formatação
magicMask.getAdvancedMaskedStrign('10500' 14, '0', 3) // Erro
MagicMask.buildMask('9+.999.999,99').getMaskedString('10500') // Retorna os mesmos 10500 sem formatação
Não sei mais oq tentar rs, queria usar essa lib. O formatter é bem bacana, só o magic que não ta rolando mesmo.
String text = '656500';
MagicMask mask = MagicMask.buildMask('R\$! !9+.999,99');
print(mask.getMaskedString(text));
//R$: 656500
it should come out like this:
R$: 6.565,00
but it comes out like this:
R$: 656500
Thanks for the amazing package, can you help me how can I mask the credit card to hide some of the numbers.
How can I make my mask accept only uppercase?
.text will get the string with mask. is there any way to get only the value without mask?
Thank you!
Lets migrate to null safety
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.