currency_dropdown 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 22

Currency Dropdown

flutter package for Currency Dropdown.

Getting Started

  • Add the package in pubspec.yaml currency_dropdown: ^0.0.2
  • Add the data file for currencies. Currency file is available inside the example project.
    • currencies.json should be within data folder in the root directory

The list of currencies is from json list added to the package thanks to mhs/world-currencies(https://github.com/mhs/world-currencies)

Note:

There might be an issue in ios where it says "The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern". Have a look at the below issue in flutter where there is a fix mentioned as well.

https://github.com/flutter/flutter/issues/9211

[0.0.1] - 14th July 2018.

  • Initial version of currency dropdown

[0.0.2] - 20th July 2018

  • Modified the code to react to value changes from the parent to the dropdown

[0.0.3] - 20th July 2018

  • Modified the selection callback to return currency symbol as well.

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),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  currency_dropdown: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:currency_dropdown/currency_dropdown.dart';
  
Version Uploaded Documentation Archive
0.0.3 Jul 20, 2018 Go to the documentation of currency_dropdown 0.0.3 Download currency_dropdown 0.0.3 archive
0.0.2 Jul 20, 2018 Go to the documentation of currency_dropdown 0.0.2 Download currency_dropdown 0.0.2 archive
0.0.1 Jul 14, 2018 Go to the documentation of currency_dropdown 0.0.1 Download currency_dropdown 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
45
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
22
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0