input_calculator 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 74

input_calculator #

With Input Calculator widget you can add functionality of calculation in an TextField.

examples #

Usage #

Initializer InputCalculator on onGenerateRoute:

Route<dynamic> _generateRoute(RouteSettings settings) {
  switch (settings.name) {

    ...

    case InputCalculator.id:
      final args = settings.arguments;
      return MaterialPageRoute(builder: (_) => InputCalculator(args: args));

    ...
  }
}

on the widget that use it

...

TextField(
    controller: _inputController,
    readOnly: true,
    onTap: () => _showInputCalculator(context),
)

...

_inputController TextEditingController to pass result value of return of InputCalculator

set readOnly: true for not show system keyboard

_showInputCalculator is the method to show InputCalculator

  void _showInputCalculator(BuildContext context) async {
    final result = await Navigator.of(context).pushNamed(
      InputCalculator.id,
      arguments: InputCalculatorArgs(

        ...

      ),
    );

    ...
  }

Let's customize it ! #

InputCalculatorArgs object of arguments supported of the widget for customize it.

class InputCalculatorArgs {
  String title;
  double initialValue;
  BoxDecoration decoration;
  Color appBarBackgroundColor;
  Color operatorButtonColor;
  Color normalButtonColor;
  Color operatorTextButtonColor;
  Color normalTextButtonColor;
  Color doneButtonColor;
  Color doneTextButtonColor;

  ...
}
  • title: title to show on appbar.

  • appBarBackgroundColor: appbar color.

  • initialValue: initial value to show on input calculator.

  • decoration: decotation of panel buttons of input calculator.

  • operatorButtonColor: color operator button of input calculator.

  • operatorTextButtonColor: color text of operator button of input calculator.

  • normalButtonColor: color normal button of input calculator.

  • normalTextButtonColor: color text of normal button of input calculator.

  • doneButtonColor: color done button of input calculator.

  • doneTextButtonColor: color text of done button of input calculator.

[1.0.1] - 04.12.2019.

  • Error: Don't import implementation files from another package resolved

[1.0.0] - 04.12.2019.

  • Initial publication

example/README.md

example #

Example for InputCalculator

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  input_calculator: ^1.0.1

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:input_calculator/input_calculator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Document public APIs. (-0.12 points)

64 out of 66 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.

Dependencies

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