input_mask 0.0.1

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

A Dart interface to use with Robin Herbot's InputMask: https://github.com/RobinHerbots/Inputmask

Not all options are added.
But you can file an issue and I will add what you need.

Usage

A simple usage example:

import 'package:input_mask/input_mask.dart';

class MyComponent {
  Mask mask;
  
  @ViewChild('inp') InputElement inputElement;
    
  OnInit() {
    // or you can get it like:
    // final inputElement = document.createElement('input'); 
    
    mask = new Mask(new MaskOptions(
        showMaskOnHover: false,
        alias: 'integer',
        rightAlign: false,
        oncomplete: allowInterop((dynamic a){
          String clean = mask.unmaskedvalue();
  
          print('Complete: $clean');
        }),
        onincomplete: allowInterop((dynamic a){
          print('Incomplete');
        }),
        oncleared: allowInterop((a){
          print('Cleared');
        })
    )).mask(inputElement);
  }
}

0.0.1

  • Initial version with some options added

example/input_mask_example.dart

import 'dart:js';
import 'dart:html';
import 'package:input_mask/input_mask.dart';

main() {
  Mask mask;

  final inputElement = document.createElement('input');
  // or you can get it like:
  // @ViewChild('inp') InputElement inputElement;

  mask = new Mask(new MaskOptions(
      showMaskOnHover: false,
      alias: 'integer',
      rightAlign: false,
      oncomplete: allowInterop((dynamic a){
        String clean = mask.unmaskedvalue();

        print('Complete: $clean');
      }),
      onincomplete: allowInterop((dynamic a){
        print('Incomplete');
      }),
      oncleared: allowInterop((a){
        print('Cleared');
      })
  )).mask(inputElement);
}

Use this package as a library

1. Depend on it

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


dependencies:
  input_mask: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:input_mask/input_mask.dart';
  
Version Uploaded Documentation Archive
0.0.1 Oct 23, 2018 Go to the documentation of input_mask 0.0.1 Download input_mask 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: web

Primary library: package:input_mask/input_mask.dart with components: html, js.

Health suggestions

Format lib/input_mask.dart.

Run dartfmt to format lib/input_mask.dart.

Format lib/src/interface.dart.

Run dartfmt to format lib/src/interface.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

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

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
js ^0.6.1+1 0.6.1+1
Dev dependencies
test ^1.0.0