v0.1.1 — live on pub.dev

Currency input,
done right.

A reusable Flutter widget that fuses a currency selector and an amount field into one generic, validated component — built for payments, invoices, and finance apps.

flutter pub add currency_input_field
AndroidiOSWebmacOSLinuxWindows
$€Checkout
CurrencyUSD
Amount
$
layoutMode

rendering inline · resize me ↔ to flip at 360px

1
widget
3
layout modes
3
validation layers
<T>
generic currency
6
platforms
features

Everything you need. Nothing you don't.

A single import gives you a typed, validated, fully themeable currency field that runs everywhere Flutter does.

Generic by design

Type it with String, an enum, or your own currency model. Full type-safety end to end — no casts, no boilerplate.

Three layout modes

inline for dashboards, stacked for mobile, adaptive to switch automatically at a breakpoint you set.

Layered validation

Validate currency, amount, or combined business rules independently — with plain Flutter form semantics.

Controller API

Read, set, and clear values programmatically. Prefill state for review and confirm flows out of the box.

Pixel-level control

Tune padding, flex ratios, divider sizing, dropdown shape, decimals, and a full style object.

Every platform

Android, iOS, Web, macOS, Linux, and Windows from one codebase — zero extra configuration.


layout modes

One widget, three layouts

Pick the layout that fits the screen — or let adaptive decide at runtime. Try them live in the demo above.

CurrencyUSD ⌄
Amount1,250.00
.inline

Inline

Currency and amount sit side by side. Best for admin dashboards and desktop forms.

CurrencyUSD ⌄
Amount1,250.00
.stacked

Stacked

Currency stacks above the amount. Best for mobile-first forms and narrow viewports.

CurrencyEUR ⌄
Amount1,250.00
.adaptive

Adaptive

Flips between inline and stacked automatically, using a stackBreakpoint you control.


quick start

Up and running in minutes

One import. One widget. Full validation and layout control out of the box — no setup, no theme wiring.

  • 1Add the dependency with flutter pub add
  • 2Create a typed CurrencyInputController<T>
  • 3Drop CurrencyInputField into any Form
main.dart
import 'package:currency_input_field/currency_input_field.dart';

final _controller = CurrencyInputController<String>(
  initialCurrency: 'USD',
);

CurrencyInputField<String>(
  controller: _controller,
  currencies: const ['USD', 'GBP', 'EUR', 'ZWG'],
  currencyLabelBuilder: (c) => c,
  layoutMode: CurrencyInputLayoutMode.adaptive,
  amountValidator: (value) {
    final amount = double.tryParse(value);
    if (amount == null || amount <= 0) {
      return 'Enter a valid amount';
    }
    return null;
  },
);

validation

Validate at the right level

Three independent hooks — currency, amount, or combined — all using plain Flutter form semantics.

currencyValidator

Restrict or flag currencies per flow — block unsupported regions before submit.

currencyValidator: (currency) {
  if (currency == 'ZAR') {
    return 'Not supported here';
  }
  return null;
},
amountValidator

Enforce minimums, maximums, or format rules purely on the numeric value.

amountValidator: (value) {
  final n = double.tryParse(value);
  if (n == null || n < 5) {
    return 'Minimum amount is 5';
  }
  return null;
},
validator

Combine currency and amount for cross-field business rules in one place.

validator: (value) {
  if (value.currency == 'USD' &&
      (value.amount ?? 0) > 500) {
    return 'USD max is 500';
  }
  return null;
},

customization

Tunable down to the pixel

From compact admin tables to spacious mobile flows — adjust spacing, behavior, and a full style object to match any design system.

Sizing & spacing

containerPaddingfieldVerticalPaddinginlineDividerHeightcurrencyFlexamountFlex

Labels & hints

useLabelTextcurrencyHintTextmonetaryHintText

Dropdown

dropdownBorderRadiusdropdownMenuMaxHeight

Input behavior

decimalDigitsallowNegativeamountKeyboardTypeamountInputFormatters

States

enabledreadOnlyAmountautofocusAmount

Theming

CurrencyInputFieldStyleborderColorfocusedBorderColoramountTextStyle

use cases

Built for real scenarios

The example app ships six production-style flows covering every layout, validation state, and styling preset.

Finance admin payoutinline

Compact inline layout, enterprise spacing, payout rules.

Mobile donation flowstacked

Stacked mobile layout, spacious padding, donation validation.

Cross-border invoiceadaptive

Enum-based currency, adaptive layout, currency-specific rules.

Fixed invoice settlementinline

Prefilled controller, read-only amount, review and confirm.

Quick transferinline

Inline with icon-decorated fields and fast-entry UX.

Wallet top-upstacked

Stacked consumer layout with icons and guided decoration.

Add it to your project

Drop one dependency into pubspec.yaml and ship a polished currency field today.

flutter pub add currency_input_field