flutter 水平多段显示小部件

Screenshot_1606210471.png

Github:

https://github.com/zhumj/HorizontalMultiSegmentDisplayWidget-flutter.git

参数:

参数 必填 类型 说明
defaultValue double
doubleValues List<double> 区间
stringValues List<String> 区间提示
colorValues List<Color> 区间颜色
strokeWidth double 线的宽度,默认 3
radius double 线上圆的半径,默认 5
textStyle TextStyle 文字风格, 默认 TextStyle(fontSize: 14,color: Colors.black)
textAlign TextAlign 文字对齐方式,默认 TextAlign.center
textDirection TextDirection 文字方向,默认 TextDirection.ltr

使用:

double defaultValue = 37.5;
List<double> doubleValues = [0, 18.5, 25.0, 30.0, 45.0,];
List<String> stringValues = ['偏瘦', '健康', '偏胖', '肥胖',];
List<Color> colorValues = [Colors.greenAccent, Colors.lightBlueAccent, Colors.orange, Colors.red,];
  
Container(
  width: MediaQuery.of(context).size.width,
  height: 80,
  color: Colors.brown,
  margin: EdgeInsets.only(top: 8),
  child: HorizontalMultiSegmentDisplayWidget(
    defaultValue, doubleValues, stringValues, colorValues,
  ),
)
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容