Search packages, repositories and app categories

Package detailsv1.0.3

flutter_counter

Flutter Counter is a simple and customisable plugin written in dart for flutter. Create it like any other widget, add params according to your need and presto!

30-day downloads
42
Likes
9
Pub points
40

Install package

flutter pub add flutter_counter

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Flutter Counter is a lightweight, customizable Dart package for Flutter that provides a simple counter widget. Easily integrated into any Flutter app, it allows developers to create incrementing and decrementing counters with configurable options such as initial value, step size, and range limits. The widget is designed to be intuitive and flexible, supporting custom styling and callbacks for state changes. Ideal for forms, quantity selectors, or interactive UI elements, it enhances user experience with minimal setup.

Use cases

  • Form input controls
  • Quantity selectors in shopping carts
  • Interactive UI elements
  • User preference settings
  • Game score tracking

Key features

  • Customizable initial value
  • Configurable step size
  • Range limit support
  • Callback on change
  • Simple integration

Suitable for

  • Beginner Flutter developers
  • Simple form components
  • Lightweight UI enhancements
  • Rapid prototyping
  • Basic numeric input needs

Considerations

  • Limited to basic counting functionality
  • No built-in validation
  • Not suitable for complex state management
  • Requires manual styling for advanced designs
  • No platform-specific optimizations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Counter (iOS & Android)

Description

Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create it like any other widget, add params according to your need and presto! You have got the highly customizeable counter with callbacks. Zero boilerplate!



Getting Started

Create this widget as you do with other widgets

Counter(
  initialValue: _defaultValue,
  minValue: 0,
  maxValue: 10,
  step: 0.5,
  decimalPlaces: 1,
  onChanged: (value) { // get the latest value from here
    setState(() {
      _defaultValue = value;
    });
  },
),

Constructor Options

There are some required values and other are for the customization

  @required num initialValue    // default value
  @required this.minValue       // minimum value
  @required this.maxValue       // maximum value
  @required this.onChanged      // callback
  @required this.decimalPlaces  // decimal places you want to show the value of
  this.color                    // color of the buttons
  this.textStyle                // text style which displays the value
  this.step = 1                 // step you want to set to change value
  this.buttonSize = 25          // if you want to change size of button

Beautify your widget with provided customization. You can also change color and size of both buttons and text. Very simple to implement and looks awesome. You can find more details in sample app.

Contributions and Licence

FlutterCounter is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using Counter in your app, send an email to [Salmaan Ahmed](mailto:salmaan.ahmed@hotmail.com)

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.