tovi 1.0.0+2 copy "tovi: ^1.0.0+2" to clipboard
tovi: ^1.0.0+2 copied to clipboard

This package provides a single class for formatting user input in a text field in Dart/Flutter applications

Tovi #

Logo

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 #

  1. Add the dependency

Open your pubspec.yaml and add the package:

dependencies:
  tovi: ^1.0.0

Then run:

flutter pub get
  1. Import the package

In your Dart/Flutter file, import the formatter:

import 'package:tovi/tovi.dart';
  1. Use in a TextField

Apply the Tovi formatter to any TextField using the inputFormatters property:

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.

0
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides a single class for formatting user input in a text field in Dart/Flutter applications

License

unknown (license)

Dependencies

flutter

More

Packages that depend on tovi