horizontal_picker 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Horizontal Picker #

You can select your value on Horizontal Picker while scrolling on items.

Samples #

Horizontal Picker - Sample 1

Horizontal Picker - Sample 2

Horizontal Picker - Sample 3

Installation #

Installing section

Usage Example #

HorizantalPicker(
  minValue: -10,
  maxValue: 50,
  divisions: 600,
  suffix: " cm",
  showCursor: false,
  backgroundColor: Colors.grey.shade900,
  activeItemTextColor: Colors.white,
  passiveItemsTextColor: Colors.amber,
  onChanged: (value) {},
),

[1.0.0] #

  • Upgraded to stable

[0.0.5] #

  • Updated read.me

[0.0.4] #

  • Fixed decimal count bug

[0.0.3] #

  • Updated read.me

[0.0.2] #

  • Initial release

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Horizontal Picker',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.grey,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double newValue;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            margin: EdgeInsets.all(10),
            height: 120,
            child: HorizantalPicker(
              minValue: 0,
              maxValue: 10,
              divisions: 10,
              onChanged: (value) {},
            ),
          ),
          Container(
            margin: EdgeInsets.all(10),
            height: 120,
            child: HorizantalPicker(
              minValue: 0,
              maxValue: 10,
              divisions: 10,
              suffix: " \u00b0C",
              showCursor: false,
              backgroundColor: Colors.lightBlue.shade50,
              activeItemTextColor: Colors.blue.shade800,
              passiveItemsTextColor: Colors.blue.shade300,
              onChanged: (value) {},
            ),
          ),
          Container(
            margin: EdgeInsets.all(10),
            height: 120,
            child: HorizantalPicker(
              minValue: -10,
              maxValue: 55,
              divisions: 600,
              suffix: " cm",
              showCursor: false,
              backgroundColor: Colors.grey.shade900,
              activeItemTextColor: Colors.white,
              passiveItemsTextColor: Colors.amber,
              onChanged: (value) {
                setState(() {
                  newValue=value;
                });
              },
            ),
          ),
          Text(newValue.toString())
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  horizontal_picker: ^1.0.0

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:horizontal_picker/horizontal_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
56
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]
78
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

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