flutter-masked-text icon indicating copy to clipboard operation
flutter-masked-text copied to clipboard

IP Address

Open wheel1992 opened this issue 7 years ago • 4 comments

Hi, I would like to mask IP Address in TextFormField. The following code is partially written and does not work. Please advice.

final controller = new MaskedTextController(mask: '#.#.#.#',
    translator: {
      '#': new RegExp(r'^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$')
    }); 
...

For each value, the number should be between 0-255.

wheel1992 avatar Aug 21 '18 01:08 wheel1992

Hi,

This will not work. Thinking in this case: If the user puts 1 2 the mask should be 1.2 or 12.? This is a custom mask intelligence that is not possible with any custom masks.

For now, I will add a label for improvement. It's a good idea to have some specific masks. It's in the roadmap.

Thanks for report and sorry for not solve you issue =/

bhrott avatar Aug 21 '18 02:08 bhrott

@benhurott Thank you so much for your reply!

wheel1992 avatar Aug 21 '18 02:08 wheel1992

any solution for ip address mask

insinfo avatar Sep 20 '21 15:09 insinfo

any update? is now 2022

tsctrl avatar Jan 24 '22 03:01 tsctrl