A collection of utilities and formatters for Flutter applications, created by VuiTv 🤖
Add to your pubspec.yaml
:
dependencies:
vuitv: ^3.22.0
- Currency formatting (USD, VND)
- Phone number formatting (US and Vietnamese formats)
- Hex color input
- Text capitalization
- Number formatting
Currency Formatter
// US currency formatter ($)
final usFormatter = CurrencyInputFormatter.us();
// Output: $1,234.56
// Vietnamese currency formatter (₫)
final vnFormatter = CurrencyInputFormatter.vn();
// Output: 1,234₫
Phone Number Formatter
// US format
final usPhone = PhoneInputFormatter();
// Input: 1234567890
// Output: (123) 456-7890
// Vietnamese format
final vnPhone = PhoneInputFormatter(const Locale('vi'));
// Input: 1234567890
// Output: 123 456 7890
Hex Color Formatter
final hexColor = HexColorInputFormatter();
// Input: #FF0000
// Output: Color(0xFFFF0000)
Text Capitalization
// Capitalize words
final wordCaps = TextCapitalizationFormatter.words();
// Input: hello world
// Output: Hello World
// Capitalize sentences
final sentenceCaps = TextCapitalizationFormatter.sentences();
// Input: hello. world.
// Output: Hello. World.