Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter number

flutter number picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons.

getting started

  1. head to /pubspec.yaml and add below dependencies like this:
dependencies:
  flutter:
    sdk: flutter
  flutter_number_picker: <latest_version>

or

dependencies:
  flutter:
    sdk: flutter
  flutter_number_picker:
      git: https://github.com/phuongtinhbien/flutter_number_picker.git
  1. run flutter packages get or use the gui equivalent
  2. now in your code import 'package:flutter_number_picker/flutter_number_picker.dart';
  3. you’re ready to go!

creating flutternumberpicker widget

customnumberpicker(
              initialvalue: 10000,
              maxvalue: 1000000,
              minvalue: 0,
              step: 10000,
              onvalue: (value) {
                print(value.tostring());
              },
            )

attribute

  • minvalue [required] is the minimum value of the buttonpicker.
  • maxvalue [required] is the maximum value of the buttonpicker.
  • initialvalue [required] is the value displayed on load.
  • onvalue [required] returns the current value.
  • step defines how much the value should increase or decrease on tap. default = 1.
  • valuetextstyle is the textstyle of the value.
  • shape is the shapeborder of the picker.
  • customaddbutton is the widget.
  • customaddbutton is the widget.

usage examples

see examples directory for full examples.

standalone widget

simulator-screen-shot---iphone-8---2020-08-22-at-13.44.02

class myapp extends statefulwidget {
  @override
  _myappstate createstate() => _myappstate();
}

class _myappstate extends state<myapp> {

  @override
  void initstate() {
    super.initstate();
  }

  // platform messages are asynchronous, so we initialize in an async method.

  @override
  widget build(buildcontext context) {
    return materialapp(
      home: scaffold(
        appbar: appbar(
          title: const text('plutter number picker'),
        ),
        body: center(
          child: container(
            child: customnumberpicker(
              initialvalue: 10000,
              maxvalue: 1000000,
              minvalue: 0,
              step: 10000,
              onvalue: (value) {
                print(value.tostring());
              },
            ),
          ),
        ),
      ),
    );
  }
}



Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.