runtut_currency_input_formatter 0.1.0 copy "runtut_currency_input_formatter: ^0.1.0" to clipboard
runtut_currency_input_formatter: ^0.1.0 copied to clipboard

A lightweight Flutter package for formatting currency input fields. Pass a locale and an ISO 4217 currency code — separators and decimal digits are derived automatically.

example/example.dart

import 'package:flutter/material.dart';
import 'package:runtut_currency_input_formatter/runtut_currency_input_formatter.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('runtut_price_formatter')),
        body: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(
            children: [
              // IDR: 1.000 (no decimals)
              TextField(
                decoration: const InputDecoration(labelText: 'IDR (1.000)'),
                inputFormatters: [CurrencyInputFormatter()],
                keyboardType: TextInputType.number,
              ),
              const SizedBox(height: 16),
              // USD: 1,000.99
              TextField(
                decoration: const InputDecoration(labelText: 'USD (1,000.99)'),
                inputFormatters: [
                  CurrencyInputFormatter(locale: 'en_US', currencyCode: 'USD'),
                ],
                keyboardType: TextInputType.number,
              ),
              const SizedBox(height: 16),
              // EUR: 1.000,99
              TextField(
                decoration: const InputDecoration(labelText: 'EUR (1.000,99)'),
                inputFormatters: [
                  CurrencyInputFormatter(locale: 'de_DE', currencyCode: 'EUR'),
                ],
                keyboardType: TextInputType.number,
              ),
              const SizedBox(height: 16),
              // JPY: 1,000 (no decimals)
              TextField(
                decoration: const InputDecoration(labelText: 'JPY (1,000)'),
                inputFormatters: [
                  CurrencyInputFormatter(locale: 'ja_JP', currencyCode: 'JPY'),
                ],
                keyboardType: TextInputType.number,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
160
points
63
downloads

Documentation

API reference

Publisher

verified publisherruntut.app

Weekly Downloads

A lightweight Flutter package for formatting currency input fields. Pass a locale and an ISO 4217 currency code — separators and decimal digits are derived automatically.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on runtut_currency_input_formatter