currency_input_formatter 0.0.5 copy "currency_input_formatter: ^0.0.5" to clipboard
currency_input_formatter: ^0.0.5 copied to clipboard

Dart 1 only

A custom Flutter TextInputFormatter for currency values

example/example.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:currency_input_formatter/currency_input_formatter.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
        title: "Currency Formatter",
        home: new Scaffold(
            appBar: new AppBar(title: new Text("Currency Formatter")),
            body: new ListView(
                padding: const EdgeInsets.symmetric(horizontal: 16.0),
                children: <Widget>[
                  new TextField(
                      autofocus: true,
                      keyboardType: TextInputType.number,
                      decoration: const InputDecoration(
                          labelText: "Salary",
                          prefixText: '\$',
                      ),
                      inputFormatters: <TextInputFormatter>[
                        new CurrencyInputFormatter(
                            allowSubdivisions: true,
                            subdivisionMarker: "."
                        ),
                      ],
                  ),
                ],
            ),
        ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A custom Flutter TextInputFormatter for currency values

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on currency_input_formatter