currency_picker 2.0.21 copy "currency_picker: ^2.0.21" to clipboard
currency_picker: ^2.0.21 copied to clipboard

A flutter package to select a currency from a list of currencies.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Demo for currency picker package',
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark(),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Demo for currency picker')),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            showCurrencyPicker(
              context: context,
              showFlag: true,
              showSearchField: true,
              showCurrencyName: true,
              showCurrencyCode: true,
              favorite: ['eur'],
              onSelect: (Currency currency) {
                print('Select currency: ${currency.name}');
              },
            );
          },
          child: const Text('Show currency picker'),
        ),
      ),
    );
  }
}
98
likes
130
pub points
97%
popularity

Publisher

unverified uploader

A flutter package to select a currency from a list of currencies.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on currency_picker