tovi 1.0.0+11
tovi: ^1.0.0+11 copied to clipboard
This package provides a single class for formatting user input in a text field in Dart/Flutter applications
Tovi #

This package provides a single class for formatting user input in a text field in Dart/Flutter applications.
Features #
🐥 Effortless Number Formatting – automatically formats user input in real-time.
🐥 Custom Separators – choose your preferred thousands and decimal separators.
🐥 Decimal Control – limit decimal places and handle fractions seamlessly.
🐥 Smart Deletion – removes digits or separators without breaking the format.
🐥 Cursor-Friendly – keeps the caret in the right position as you type.
🐥 Plug & Play – works instantly with any Flutter TextField.
Installation #
- Add the dependency
flutter pub add tovi
- Import the package
import 'package:tovi/tovi.dart';
- Use in a TextField
TextField(
keyboardType: TextInputType.numberWithOptions(decimal: true),
inputFormatters: [
Tovi(
thousandsSeparator: ",",
decimalSeparator: ".",
maxDecimals: 2,
),
],
decoration: InputDecoration(
labelText: "Enter amount",
),
)
💡 Tip: You can customize separators, enable/disable decimals, and set the maximum decimal precision to fit your use case.