flutter_currency_input_formatter 1.0.0 copy "flutter_currency_input_formatter: ^1.0.0" to clipboard
flutter_currency_input_formatter: ^1.0.0 copied to clipboard

A Flutter package for dynamically formatted currency input fields with custom symbols, decimal control, and max-length limits.

example/main.dart

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

void main() {
  runApp(const ExampleApp());
}

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  final TextEditingController textEditingController = TextEditingController();

  @override
  void dispose() {
    textEditingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Currency Input Example')),
        body: Padding(
          padding: const EdgeInsets.all(16.0),
          child: TextField(
            controller: textEditingController,
            keyboardType:
            const TextInputType.numberWithOptions(decimal: true, signed: false),
            inputFormatters: [
              CurrencyInputFormatter(
                currencySymbol: '\$',
                symbolOnLeft: false,
                decimalDigits: 2,
                maxIntegerDigits: 6,
              ),
            ],
            decoration: const InputDecoration(
              labelText: 'Amount',
              border: OutlineInputBorder(),
              hintText: '0\$',
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
907
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package for dynamically formatted currency input fields with custom symbols, decimal control, and max-length limits.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_currency_input_formatter