A fluid design slider that works just like the Slider material widget.

Overview

Fluid Slider for Flutter

Awesome Flutter

Inspired by a dribbble by Virgil Pana.

enter image description here

A fluid design slider that works just like the Slider material widget.

Used to select from a range of values.

Installation

Just add the package to your dependencies in the pubspec.yaml file:

dependencies:
  flutter_fluid_slider: ^1.0.2

Basic Usage

Place the FluidSlider in your widget tree.

FluidSlider(
  value: _value,
  onChanged: (double newValue) {
    setState(() {
      _value = newValue;
    });
  },
  min: 0.0,
  max: 100.0,
),

Properties

  • value : [Required] The currently selected value for this slider. The slider's thumb is drawn at a position that corresponds to this value.

  • min : The minimum value the user can select. Defaults to 0.0. Must be less than or equal to max.

  • max : The maximum value the user can select. Defaults to 1.0. Must be less than or equal to min.

  • start : The widget to be displayed as the min label. For eg: an Icon can be displayed. If not provided the min value is displayed as text.

  • end : The widget to be displayed as the max label. For eg: an Icon can be displayed. If not provided the max value is displayed as text.

  • onChanged : [Required] Called during a drag when the user is selecting a new value for the slider

    by dragging.

    • The slider passes the new value to the callback but does not actually change state until the parent widget rebuilds the slider with the new value.

    • If null, the slider will be displayed as disabled.

  • onChangeStart : Called when the user starts selecting a new value for the slider. The value passed will be the last value that the slider had before the change began.

  • onChangeEnd : Called when the user is done selecting a new value for the slider.

  • labelsTextStyle : The styling of the min and max text that gets displayed on the slider. If not provided the ancestor Theme's accentTextTheme text style will be applied.

  • valueTextStyle : The styling of the current value text that gets displayed on the slider. If not provided the ancestor Theme's textTheme.title text style with bold will be applied .

  • sliderColor : The color of the slider. If not provided the ancestor Theme's primaryColor will be applied.

  • thumbColor : The color of the thumb. If not provided the Colors.white will be applied.

  • showDecimalValue : Whether to display the first decimal value of the slider value. Defaults to false.

  • mapValueToString : called with value for the String to be rendered in the slider's thumb. E.g. display roman integers as follows:

    FluidSlider(
      value:_val,
      min:1.0,
      max:5.0,
      onChanged:(){},
      mapValueToString: (double value){
        List<String> romanNumerals=['I', 'II', 'III', 'IV', 'V'];
        return _romanNumerals[value.toInt() - 1];
      }
    )

    See example. If null the value is converted to String based on [showDecimalValue].

Credits:

Comments
  • slider disables when onClick happend

    slider disables when onClick happend

    Is there any way to stop the slider from disabling when er was a onClick event. I want all times te value can be changed, in the app the slider is a volume slider.

    opened by kimwijfje 1
  • `thumbDiameter` was exposed as a param

    `thumbDiameter` was exposed as a param

    Because the height of the slider looks like too big on smaller devices, this PR adds the ability to set a custom diameter or height to the slider.

    If no value is set, the default value is 60.0.

    This change not break the current code.

    opened by diegoveloper 0
  • Can't slide :(

    Can't slide :(

    Hello,

    Good job ! Everything works fine except that I can't slide :/ The fluid animation appen when I press the slider but nothing when I slide to left or right :/

    [flutter] flutter doctor -v [√] Flutter (Channel stable, v1.9.1+hotfix.5, on Microsoft Windows [version 10.0.18362.418], locale fr-FR) • Flutter version 1.9.1+hotfix.5 at C:\src\flutter • Framework revision 1aedbb1835 (3 days ago), 2019-10-17 08:37:27 -0700 • Engine revision b863200c37 • Dart version 2.5.0

    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\quent\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03) • All Android licenses accepted.

    [!] Android Studio (version 3.5) • Android Studio at C:\Program Files\Android\Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

    [√] VS Code (version 1.39.2) • VS Code at C:\Users\quent\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.5.1

    [√] Connected device (1 available) • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 8.0.0 (API 26) (emulator)

    ! Doctor found issues in 1 category. exit code 0

    opened by QuentinSc 0
  • TextTheme error when using flutter_fluid_slider

    TextTheme error when using flutter_fluid_slider

    Compile failed

    ../.pub-cache/hosted/pub.dartlang.org/flutter_fluid_slider-1.0.3/lib/flutter_fluid_slider.dart:292:14: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.

    • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('packages/flutter/lib/src/material/text_theme.dart').

    Try correcting the name to the name of an existing getter, or defining a getter or field named 'subhead'.

            .subhead
    
             ^^^^^^^
    

    ../.pub-cache/hosted/pub.dartlang.org/flutter_fluid_slider-1.0.3/lib/flutter_fluid_slider.dart:296:14: Error: The getter 'title' isn't defined for the class 'TextTheme'.

    • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('packages/flutter/lib/src/material/text_theme.dart').

    Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.

            .title
    
             ^^^^^
    

    ../.pub-cache/hosted/pub.dartlang.org/flutter_fluid_slider-1.0.3/lib/flutter_fluid_slider.dart:482:69: Error: The getter 'title' isn't defined for the class 'TextTheme'.

    • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('packages/flutter/lib/src/material/text_theme.dart').

    Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.

              style: textStyle ?? Theme.of(context).accentTextTheme.title,
    
                                                                    ^^^^^
    
    opened by dannythebestguy 1
  • Fix/smooth animation

    Fix/smooth animation

    Original Animation (Bounce Out):

    Screen Capture__20200727034442

    Here, as you can see, the bounce comes in with a delay, which seems a bit jittery or off.

    Decelerate

    Screen Capture__20200727035627

    Here, it pops out, but does not bounce, so it seems smoother than before. I have also reduced the duration of the animation to reduce the apparent time delay between actual drag start and the drag behaviour of the animation.

    FastOutSlowIn:

    Screen Capture__20200727034555

    This is also similar to Decelerate but a bit less like it. Personally, I would prefer decelerate over this any day, but its upto you to choose. I looked up the actual design and found out that Decelerate would come closest to it.

    closes: #16

    opened by maddyb99 0
Owner
Vamsi Krishna
Vamsi Krishna
Sleek circular slider/progress bar & spinner for Flutter

Sleek circular slider/progress bar & spinner for Flutter A highly customizable circular slider/progress bar & spinner for Flutter. Getting Started Ins

Mat Nuckowski 477 Jan 2, 2023
RangeSlider Widget for Flutter

RangeSlider An extension of the Flutter Material Slider to allow selection of a range of values via 2 thumbs. Step by step explanation A full explanat

Didier Boelens 360 Dec 30, 2022
A fluid design slider that works just like the Slider material widget.

Fluid Slider for Flutter Inspired by a dribbble by Virgil Pana. A fluid design slider that works just like the Slider material widget. Used to select

Vamsi Krishna 311 Dec 30, 2022
MindInventory 15 Sep 5, 2022
A material design slider and range slider with rtl support and lots of options and customization for flutter

flutter_xlider (Flutter Slider) A material design slider and range slider, horizontal and vertical, with rtl support and lots of options and customiza

null 407 Jan 6, 2023
The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

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

Wilton Neto 41 Sep 30, 2022
PaperOnboarding is a material design slider made by @Ramotion

PAPER ONBOARDING Android library Paper Onboarding is a material design UI slider written on Java We specialize in the designing and coding of custom U

Ramotion 2.6k Dec 28, 2022
A flutter widget for comparing two stacked widgets by dragging a slider thumb to reveal either sides of the slider horizontally or vertically.

Juxtapose A flutter widget for comparing two stacked widgets by dragging a slider thumb to reveal either sides of the slider horizontally or verticall

Leslie Arkorful 74 Nov 24, 2022
Flutter custom carousel slider - A carousel slider widget,support custom decoration suitable for news and blog

flutter_custom_carousel_slider A carousel slider Flutter widget, supports custom

Emre 40 Dec 29, 2022
A Very Flexible Widget that can Implement Material Sheets on all Directions, both modal and persistent, and consequently a Material Navigation Drawer

Flutter_MaterialSheetAndNavigationDrawer If this project helped you reduce developement time or you just want to help me continue making useful tools

Bryan Cancel 30 Dec 4, 2021
Deepak Sharma 149 Dec 10, 2022
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.

like_button Language: English | 中文简体 Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's h

FlutterCandies 357 Dec 27, 2022
Highly customizable, feature-packed calendar works like google calendar but with more features.

Beca [In Progress] Beca is a Calendar that you could manage your daily tasks and schedule meetings with your friends just like google calendar Concept

Mohammad Javad Hossieni 19 Nov 15, 2022
Just audio background - A flutter package plugs into just audio to add background playback support and remote controls

just_audio_background This package plugs into just_audio to add background playb

lonyyy 1 Jan 11, 2022
Snake-Game - A flutter based classic snake game with nothing just and just a feel to have play

snake_game This is a simple snake Game under development made with the help of y

Shubham Kumar 2 Mar 22, 2022
It's a universal app template to have a great animated splash screen and liquid slider. Just change the animation if you want (rive) and change the images or colours according to your app.

liquid A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

Zikyan Rasheed 28 Oct 7, 2022
Uses a Canvas to create a fluid-style navigation bar with flutter

fluid_nav_test_project Fluid Button Bar (null safety) Uses a Canvas to create a fluid-style navigation bar that has a fun bouncy feel to it; also show

Promise Amadi 5 Nov 9, 2022
Amazing task management application with fluid, minimal and modern UI using Flutter! One of The Winner Apps for Google DevFest 2021!

Orb "Let your task orbit!" ?? Description Orb is an easy-to-use task manager app that help you manage your daily struggles to get your things done eff

Tom Huynh 9 Oct 28, 2022
Fluid layouts allows you to create responsive layout for mobile, web and desktop from a single codebase.

Fluid layout aims to help building a responsive experience through all the different screen sizes. Based in the boostrap approach, FluidLayout calculates a padding content (fluid_padding) that changes depending on the parent size. The Fluid widget uses that padding to set its size

Jaime Blasco 3 Jan 10, 2022
A Flutter package consisting of pre animated cards(containers) with fluid animation for freely adding user customized cards to the app with heavy customizable options adding up to an incredible UI experience

A Flutter package consisting of pre animated cards(containers) with fluid animation for freely adding user customized cards to the app with heavy customizable options adding up to an incredible UI experience

Shantanu 12 Dec 30, 2022