currency_dropdown 0.0.3 copy "currency_dropdown: ^0.0.3" to clipboard
currency_dropdown: ^0.0.3 copied to clipboard

Dart 1 only

Currency dropdown widget.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.green,
      ),
      home: new MyHomePage(title: 'Flutter Currency Drop down'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String currencyValue = 'INR';
  String currencySymbol = '';

  _onCurrencyChanged(val, symbol) {
    setState(() {
      currencyValue = val;
      currencySymbol = symbol;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.all(10.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text('Currency'),
            CurrencyDropDown(
                currencyValue: currencyValue, onChanged: _onCurrencyChanged),
          ],
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Currency dropdown widget.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on currency_dropdown