SignalStrengthIndicator.bars constructor
SignalStrengthIndicator.bars({})
Creates signal strength indicator with bars.
You have to provide value
which should be in range
from minValue
to maxValue
(default 0.0 to 1.0).
Number of bars can be specified by barCount
(reasonable number of bars is 3,4 or maybe 5).
Indicator can be bevelled
or have radius
but not both.
To specify how the indicator should behave, use levels
. Levels values
are absolute values from minValue
- maxValue
and number of levels is
the same as barCount
For example:
SignalStrengthIndicator.bars(
value: val,
minValue: 0,
maxValue: 100,
levels: <num, Color>{
25: Colors.red,
50: Colors.yellow,
75: Colors.green,
},
)
means that first bar will be red when value is greater than 25, first and second bar will be yellow when value is greater than 50 and all bars will be green when value is greater than 75.
Implementation
SignalStrengthIndicator.bars({
Key? key,
required num value,
double? size,
int barCount = 3,
num? minValue,
num? maxValue,
Color? activeColor,
Color? inactiveColor,
Map<num, Color>? levels,
Radius? radius,
bool bevelled = false,
double spacing = 0.2,
EdgeInsets margin = EdgeInsets.zero,
}) : this(
key: key,
style: BarSignalStrengthIndicatorStyle(
value: value,
minValue: minValue,
maxValue: maxValue,
barCount: barCount,
activeColor: activeColor,
inactiveColor: inactiveColor,
levels: levels,
size: size,
radius: radius,
bevelled: bevelled,
spacing: spacing,
margin: margin,
),
);