text_formatters 1.0.0

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

text_formatters

A package of pre-build TextInputFormatter objects to use with Flutter's TextField or TextFormField widgets.

Formatters

  • UppercaseInputFormatter, example 'THISISMYTEXT'
  • LowercaseInputFormatter, example 'thisismytext'
  • AlternatingCapsInputFormatter, example 'ThIsIsMyTeXt'

Usage

new TextField(
    inputFormatters: [
        UppercaseInputFormatter(),
    ],
),

Dependencies

This widget set relies on these external third-party components:

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.

If you fixed a bug or implemented a new feature, please send a pull request.

If you want to discuss this project, please join the Discord chat.

[0.0.1] - 2018-08-17

  • Added LowercaseInputFormatter
  • Added UppercaseInputFormatter
  • Added AlternatingCapsInputFormatter

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Text Formatters Demo',
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Text Formatters Example'),
      ),
      body: new Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          new TextField(
            decoration: InputDecoration(
              labelText: "(no formatter)",
            ),
          ),
          new TextField(
            decoration: InputDecoration(
              labelText: "UppercaseInputFormatter",
            ),
            inputFormatters: [
              UppercaseInputFormatter(),
            ],
          ),
          new TextField(
            decoration: InputDecoration(
              labelText: "LowercaseInputFormatter",
            ),
            inputFormatters: [
              LowercaseInputFormatter(),
            ],
          ),
          new TextField(
            decoration: InputDecoration(
              labelText: "AlternatingCapsInputFormatter",
            ),
            inputFormatters: [
              AlternatingCapsInputFormatter(),
            ],
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  text_formatters: ^1.0.0

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:text_formatters/text_formatters.dart';
  
Version Uploaded Documentation Archive
1.0.0 Aug 17, 2018 Go to the documentation of text_formatters 1.0.0 Download text_formatters 1.0.0 archive
0.0.1+2 Aug 17, 2018 Go to the documentation of text_formatters 0.0.1+2 Download text_formatters 0.0.1+2 archive
0.0.1 Aug 17, 2018 Go to the documentation of text_formatters 0.0.1 Download text_formatters 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]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
16
Learn more about scoring.

We analyzed this package on Sep 21, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Fix dependencies in pubspec.yaml.

Running flutter packages pub upgrade failed with the following output:

ERR: The current Flutter SDK version is 0.8.4.
 
 Because text_formatters depends on groovin_string_masks any which requires Flutter SDK version ^0.5.1, version solving failed.

Dependencies

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