spinner_input 0.1.1

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

Spinner Input #

A Spinner Input for flutter like HTML5 input-spinner

You can find examples in example directory

[0.1.1] - 02/09/2019.

example/example.dart

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

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

class MySpinner extends StatefulWidget {
  @override
  _MySpinnerState createState() => _MySpinnerState();
}

class _MySpinnerState extends State<MySpinner> {
  double spinner = 0;
  double spinner3 = -5;
  double spinner4 = 20;
  double spinner5 = 82.654;
  double spinner6 = 5;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
          appBar: AppBar(),
          body: Column(
            children: <Widget>[


              // default spinner
              Container(
                margin: EdgeInsets.all(20),
                child: SpinnerInput(
                  spinnerValue: spinner,
//                  minValue: 0,
//                  maxValue: 200,
                  onChange: (newValue) {
                    setState(() {
                      spinner = newValue;
                    });
                  },
                ),
              ),



              // Set step ( can be int or double )
              Container(
                margin: EdgeInsets.all(20),
                child: SpinnerInput(
                  minValue: 0,
                  maxValue: 200,
                  step: 5,
                  plusButton: SpinnerButtonStyle(elevation: 0, color: Colors.blue, borderRadius: BorderRadius.circular(0)),
                  minusButton: SpinnerButtonStyle(elevation: 0, color: Colors.red, borderRadius: BorderRadius.circular(0)),
                  middleNumberWidth: 70,
                  middleNumberStyle: TextStyle(fontSize: 21),
                  middleNumberBackground: Colors.yellowAccent.withOpacity(0.5),
                  spinnerValue: spinner3,
                  onChange: (newValue) {
                    setState(() {
                      spinner3 = newValue;
                    });
                  },
                ),
              ),




              // Disable long press and input-popup
              Container(
                margin: EdgeInsets.all(20),
                child: SpinnerInput(
                  minValue: 0,
                  maxValue: 200,
                  disabledLongPress: true,
                  disabledPopup: true,
                  step: 5,
                  spinnerValue: spinner4,
                  onChange: (newValue) {
                    setState(() {
                      spinner4 = newValue;
                    });
                  },
                ),
              ),


              // A little more customized buttons
              Container(
                margin: EdgeInsets.all(20),
                child: SpinnerInput(
                  minValue: 0,
                  maxValue: 200,
                  step: 5.524,
                  fractionDigits: 3,
                  plusButton: SpinnerButtonStyle(
                      color: Colors.green,
                      height: 60,
                      width: 60,
                      elevation: 1,
                      highlightElevation: 10,
                      child: Icon(Icons.thumb_up)
                  ),
                  minusButton: SpinnerButtonStyle(
                    color: Colors.red,
                    borderRadius: BorderRadius.circular(0),
                  ),
                  spinnerValue: spinner5,
                  onChange: (newValue) {
                    setState(() {
                      spinner5 = newValue;
                    });
                  },
                ),
              ),



              // RTL support
              Container(
                margin: EdgeInsets.all(50),
                child: SpinnerInput(
                  direction: TextDirection.rtl,
                  spinnerValue: spinner6,
                  onChange: (newValue) {
                    setState(() {
                      spinner6 = newValue;
                    });
                  },
                ),
              )




            ],
          ),
        ));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  spinner_input: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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:spinner_input/spinner_input.dart';
  
Version Uploaded Documentation Archive
0.1.1 Feb 9, 2019 Go to the documentation of spinner_input 0.1.1 Download spinner_input 0.1.1 archive
0.1.0 Feb 9, 2019 Go to the documentation of spinner_input 0.1.0 Download spinner_input 0.1.0 archive
0.0.1 Feb 9, 2019 Go to the documentation of spinner_input 0.0.1 Download spinner_input 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
9
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]
55
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test