Giter Club home page Giter Club logo

unit_converter's Introduction

unit_converter

Twitter

A library to easily convert between units of different system.

Show some ❤️ and star the repo to support the project

GitHub starsGitHub forksGitHub watchers

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

unit_converter: <latest_version>

Usage

If you want to convert area units, get an instance of area converter, and call the convert method:

import 'package:unit_converter/unit_converter.dart';

main() {
  var areaConverter = getConverter(Converter.area);
  areaConverter.convert(value: 2, from: AreaUnit.acre, to: AreaUnit.squareFoot);
}

Get the available units:

  var avilableUnits = areaConverter.units();

Each unit have a name(British spelling) and an americanName(American spelling) property. For units that have the same americanName as name, the americanName is null. So, it is always good to check for the availability of americanName before displaying it.

  for(var unit in avilableUnits) {
    if(unit.americanName != null) {
      print(unit.americanName);
    } else {
      print(unit.name);
    }
  }

Donations

This project needs you! If you would like to support the creator of this project or the continuous development and maintenance of this project, feel free to donate. Your donation is highly appreciated. Thank you!

PayPal

  • Donate $5: Thank's for creating this project, here's a tea (or some juice) for you!
  • Donate $10: Wow, I am amazed. Let me take you to the movies!
  • Donate $15: I really appreciate your work, let's grab some lunch!
  • Donate $25: That's some awesome stuff you did right there, dinner is on me!
  • Donate $50: I really really want to support this project, great job!
  • Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
  • Donate $2799: Go buddy, buy Macbook Pro for yourself!

Of course, you can also choose what you want to donate, all donations are awesome!

Features and bugs

Please file feature requests and bugs at the issue tracker.

How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

unit_converter's People

Contributors

arabbani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.