Skip to content

Instantly share code, notes, and snippets.

@albertosales
albertosales / CurrencyPtBrInputFormatter.dart
Created April 11, 2024 14:48 — forked from andre-bahia/CurrencyPtBrInputFormatter.dart
Flutter TextInputFormatter Currency pt_BR
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
class CurrencyPtBrInputFormatter extends TextInputFormatter {
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
if(newValue.selection.baseOffset == 0){
return newValue;
}