2023-06-06 06:54:51 +00:00
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';
|
2023-05-11 00:04:53 +00:00
|
|
|
|
|
|
|
var mobileFormatter = MaskTextInputFormatter(
|
|
|
|
mask: "+63 (###) ###-####",
|
|
|
|
filter: {"#": RegExp(r"^[1-9][0-9]*$")},
|
|
|
|
type: MaskAutoCompletionType.lazy,
|
|
|
|
initialText: "0");
|
|
|
|
|
|
|
|
var landLineFormatter = MaskTextInputFormatter(
|
|
|
|
mask: "(###) ###-###",
|
|
|
|
filter: {"#": RegExp(r"^[0-9]")},
|
|
|
|
type: MaskAutoCompletionType.lazy,
|
2023-06-06 06:54:51 +00:00
|
|
|
initialText: "0");
|
|
|
|
|
|
|
|
class UpperCaseTextFormatter extends TextInputFormatter {
|
|
|
|
@override
|
|
|
|
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
|
|
|
|
return TextEditingValue(
|
|
|
|
text: newValue.text.toUpperCase(),
|
|
|
|
selection: newValue.selection,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|