button_picker 0.1.6 copy "button_picker: ^0.1.6" to clipboard
button_picker: ^0.1.6 copied to clipboard

Customizable Flutter number picker using buttons instead of scroll.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:button_picker/button_picker.dart';
import 'package:flutter/rendering.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    debugPaintSizeEnabled = false;

    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: ButtonPicker(
            minValue: 0, /// required
            maxValue: 10, /// required
            initialValue: 0, /// required
            onChanged: (val) => print(val), /// required
            step: 2.5,
            horizontal: false,
            loop: false,
            padding: 5.0,
            iconUp: Icons.keyboard_arrow_up,
            iconDown: Icons.keyboard_arrow_down,
            iconLeft: Icons.keyboard_arrow_left,
            iconRight: Icons.keyboard_arrow_right,
            iconUpRightColor: Colors.blue,
            iconDownLeftColor: Colors.blue,
            style: TextStyle(
              fontSize: 48.0,
              color: Colors.blue
            ),
          ),
        ),
      ),
    );
  }
}
6
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Customizable Flutter number picker using buttons instead of scroll.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on button_picker