number_to_words_spelling 0.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

number_to_words_spelling #

Number to Words Spelling.

PackageInfo #

This flutter package provide function to convert number to words.

example: 123 => seratus dua puluh tiga

Supported Language: #

  • Indonesia
  • English - US

Installation dan version #

https://pub.dartlang.org/packages/number_to_words_spelling

Usage #

import 'package:number_to_words_spelling/number_to_words_spelling.dart';

String _wordEn = NumberWordsSpelling.toWord('123456','en_US');

String _wordInd = NumberWordsSpelling.toWord('123456','id');

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

[0.0.5] 02-Apr-2019 #

  • Add Indonesian Language
  • Add English_US Language

[0.0.1] 01-Apr-2019 #

  • TODO: Describe initial release.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  String _words_en='';
  String _words_id='';
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            TextField(
              onChanged: (val) {
                setState(() {
                  _words_en = NumberWordsSpelling.toWord(val,'en_US');
                  _words_id = NumberWordsSpelling.toWord(val,'id');
                });
              },
            ),
            Text(_words_id),
            Text(_words_en),
          ],
        ),
      )
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  number_to_words_spelling: ^0.0.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:number_to_words_spelling/number_to_words_spelling.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
43
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Jun 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/id.dart. (-1.49 points)

Analysis of lib/src/id.dart reported 3 hints:

line 1 col 7: Name types using UpperCamelCase.

line 76 col 11: Equality operator == invocation with references of unrelated types.

line 79 col 16: Equality operator == invocation with references of unrelated types.

Fix lib/src/en.dart. (-0.50 points)

Analysis of lib/src/en.dart reported 1 hint:

line 3 col 7: Name types using UpperCamelCase.

Format lib/number_to_words_spelling.dart.

Run flutter format to format lib/number_to_words_spelling.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (intl).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-17.26 points)

The package was last published 61 weeks ago.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
intl ^0.15.8 0.15.8 0.16.1
Transitive dependencies
collection 1.14.12
meta 1.1.8
path 1.7.0
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test