flutter,渐变色滑块插件slider_gradient使用说明

插件地址:slider_gradient

应用场景

请添加图片描述

参数说明

NameTypeDescriptionDefault
valueintDefault valueSlider default minimum
valuesListisRange = true, values must be passed as a valid value and cannot be empty-
isRangeboolwhether to use the rangefalse
minintSlider minimum0
maxintSlider maximum100
isShowLabelboolShow the label on the sliderfalse
labelStringLabel displays data. It is valid only when “isShowlabel” is true.null
isGradientBgboolWhether the background color of the background slider is a gradient.true
onChangeSliderChangeCallbackA custom callback function that triggers as long as the slider movesnull
onChangeEndSliderChangeCallbackA Custom callback function triggered by slider stop movementnull
onChangeBeginSliderChangeCallbackA Custom callback function triggered by slider start movementnull
colorsList< Color >Slider background gradient from left to right,When isgradientbg = true, it is the gradient color array. When isgradientbg = false, when it is not set, the main color of the slider is the current theme color of the system, and the auxiliary color is white. When colors is set, the main color is the first in the array and the auxiliary color is the lastThere are two colors by default, the first app is the main color, and the second is white
labelStyleLabelStyleCustom label stylethis
sliderStyleSliderStyleslider label stylethis
thumbStyleThumbStylethumb label stylethis

总结

开发项目时需要一个渐变色背景的滑块,大概找了下没找到合适的,刚好有时间所以就自己写了一个,内容比较冷门想着以后有可能还会用到就练手写了个插件。最后非常感谢 Magic旭 他的 Flutter-如何计算文字宽高 文章对我帮助很大。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值