horizontal_picker 0.0.4 copy "horizontal_picker: ^0.0.4" to clipboard
horizontal_picker: ^0.0.4 copied to clipboard

outdated

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

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())
        ],
      ),
    );
  }
}
60
likes
0
points
268
downloads

Publisher

verified publisherleventkantaroglu.com

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on horizontal_picker