• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rvamsikrishna/flutter_fluid_slider: A fluid design slider that works just like t ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

rvamsikrishna/flutter_fluid_slider

开源软件地址(OpenSource Url):

https://github.com/rvamsikrishna/flutter_fluid_slider

开源编程语言(OpenSource Language):

Dart 89.1%

开源软件介绍(OpenSource Introduction):

Fluid Slider for Flutter

Awesome Flutter

Inspired by a dribbble by Virgil Pana.

demo

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:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
gmdjs/gmdjs: Grid Material Design发布时间:2022-08-18
下一篇:
pubnub/paper-chat: A simple chat room in Material Design build with Polymer (Pol ...发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap