Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

Fluid Slider Component for Flutter

Fluid Slider Flutter

The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

About

The component was created to better simulate all the component behavior in the inspiration video. The component is editable and only require the Flutter framework and no other third-party library.

The App

The GIF below shows this current component running.

Constructor

The component is called SliderBall in this project. The constructor is:

SliderBall(
      {
        this.backgroundColor = const Color(0xFF6168E7),
        this.borderRadius = const BorderRadius.all(Radius.circular(10)),
        this.initialValue,
        this.finalValue,
        this.textStyle = const TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.bold),
        this.onSelectStart,
        this.onSelectEnd
      }
      ): assert(initialValue != null && finalValue != null), 
         assert(initialValue < finalValue), 
         assert(textStyle.fontSize != null);

Example

Code

new SliderBall( 
  initialValue: 20, 
  finalValue: 40, 
  backgroundColor: Colors.black87, 
  textStyle: TextStyle(
    color: Colors.green, 
    fontSize: 15, 
    fontWeight: FontWeight.bold
  )
)

Result

Download Fluid Slider Component source code on GitHub

https://github.com/wiltonribeiro/fluid_slider_flutter

Exit mobile version