Search packages, repositories and app categories

input_slider cover
Package detailsv0.3.1

input_slider

A customizable input that synchronizes a Slider and a TextField.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
435
Likes
25
Pub points
150

Install package

flutter pub add input_slider

Package Overview

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

The input_slider package provides a synchronized input component that links a Slider and a TextField, ensuring both remain in sync as users interact with either. It is highly customizable, allowing developers to adjust appearance, range, step size, and formatting. Ideal for forms requiring precise numeric input with visual feedback, it supports all major platforms including mobile, web, and desktop. The package simplifies the creation of intuitive number inputs without manual synchronization logic.

Use cases

  • Form inputs requiring precise numeric values
  • Interactive settings with visual sliders
  • Synchronized numeric entry across UI elements
  • Customizable input fields for dashboards
  • Real-time value adjustments in applications
  • Cross-platform numeric input components

Key features

  • Bidirectional sync between Slider and TextField
  • Customizable range and step values
  • Supports decimal and integer input
  • Platform-agnostic design
  • Extensible styling options
  • Built-in validation and formatting

Suitable for

  • Developers building interactive forms
  • Designers needing responsive numeric inputs
  • Apps requiring consistent user input handling
  • Cross-platform Flutter applications
  • UI components with real-time feedback

Considerations

  • Requires careful handling of decimal precision
  • May need additional validation for edge cases
  • Not ideal for non-numeric data types
  • Limited to numeric input use cases
  • Potential performance impact with frequent updates
  • Depends on external dependencies for full functionality

Original README

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

Pub

input_slider

While Sliders offer a quick and visual way to change a value, it can be hard to achieve precise inputs with them. Additionally, some users really dislike Sliders, and especially on small devices they can get quite fiddly. One way to use the advantages of having a Slider while minimizing the drawbacks is to add an additional alternativ (text) input field.

This packages InputSlider combines a TextField with a Slider and synchronizes both of them. They share the same minimum and maximum values and changes made to one also changes the other. Optionally, you can also specify a leading widget, such as a label Text or Icon.

grafik

Usage

InputSlider(
  onChange: (value) => print("change: $value"),
  min: 0.0,
  max: 100.0,
  decimalPlaces: 0,
  value: 50.0,
  leading: Text("Percentage:"),
)

Input Slider Forms

You can group multiple InputSlider together using an InputSliderForm. By specifying leadingWeight and sliderWeight it is possible to align them together. They can be also styled together or individually.

InputSliderForm(
    leadingWeight: 1,
    sliderWeight: 20,
    activeSliderColor: Colors.red,
    inactiveSliderColor: Colors.green[100],
    filled: true,
    vertical: true,
    children: [
      InputSlider(
        onChange: (value) {
          print("Setting 1 changed");
        },
        min: 0.0,
        max: 10.0,
        decimalPlaces: 0,
        defaultValue: 5.0,
        leading: Text("Setting 1:"),
      ),
      InputSlider(
        onChange: (value) {
          print("Setting 2 changed");
        },
        min: 0.0,
        max: 1.0,
        decimalPlaces: 3,
        defaultValue: 0.32,
      ),
)

Sliders can be rotated by 90 degrees by setting vertical=true. This can be done to individual InputSliders or to InputSliderForms.

photo_2021-07-10_13-54-59

Categories

Source repository

Projects using this package

No data available yet.