imei_validator 0.1.2

  • README.md
  • Installing
  • Versions
  • 58

imei_validator

imei_validator is a library for checking IMEIs using the Luhn algorithm.

Installing

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

dependencies:
  imei_validator: any

If you're using the Dart Editor, choose:

Menu > Tools > Pub Install

Or if you want to install from the command line, run:

$ pub install

Now in your Dart code, you can use:

import 'package:imei_validator/imei_validator.dart';

Overview

var imei = new ImeiValidator("378282246310005");
print(imei.isValid); // true

Note: imei_validator will automatically remove any space or dashes from the string passed to it

Check Digit

You can calculate a check digit by creating a new ImeiValidator and passing in an meid (14 digits). The ImeiValidator will automatically calculate the check digit and make it available via the checkDigit getter.

var imei = new ImeiValidator("37828224631000");
print(imei.checkDigit); // 5

Use this package as a library

1. Depend on it

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


dependencies:
  imei_validator: ^0.1.2

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:imei_validator/imei_validator.dart';
  
Version Uploaded Documentation Archive
0.1.2 May 27, 2018 Go to the documentation of imei_validator 0.1.2 Download imei_validator 0.1.2 archive
0.1.1 May 27, 2018 Go to the documentation of imei_validator 0.1.1 Download imei_validator 0.1.1 archive
0.1.0 May 27, 2018 Go to the documentation of imei_validator 0.1.0 Download imei_validator 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
24
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:imei_validator/imei_validator.dart.

Issues and suggestions

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Maintain an example.

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use imei_validator.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.3 <3.0.0
Dev dependencies
unittest >0.10.1 <0.11.0