Skip to content

zhumj/HorizontalMultiSegmentDisplayWidget-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

水平多段显示小部件

参数:

参数 必填 类型 说明
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,
  ),
)

About

水平多段显示小部件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published