BatteryIndicator class

Inheritance

Constructors

BatteryIndicator({bool batteryFromPhone = true, int batteryLevel = 25, BatteryIndicatorStyle style = BatteryIndicatorStyle.flat, double ratio = 2.5, Color mainColor = Colors.black, bool colorful = true, bool showPercentNum = true, bool showPercentSlide = true, double? percentNumSize, double size = 14.0})

Properties

batteryFromPhone bool
boolean to choose from where to obtain the value of the battery if it is true, the indicator will update in base of the phone battery, if not, you can controll with a variable
final
batteryLevel int
final
colorful bool
彩色模式,为true时自动根据电量绘制不同的颜色,为false时填充主体色 if colorful = true , then the fill color will automatic change depend on battery value
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainColor Color
主体颜色,包括边框和单色模式下的填充色 color of borderline , and fill color when colorful is false
final
percentNumSize double?
battery value font size, default to null
final
ratio double
控制横宽比例,默认为2.5:1 widget`s width / height , default to 2.5:1
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showPercentNum bool
是否绘制百分比数字,建议单色模式下不要开启显示百分比 whether show battery value , Recommended NOT set to True when colorful = false
final
showPercentSlide bool
是否绘制百分比的电量填充 whether paint fill color
final
size double
控制整体大小,默认14.0,建议不要太大,否则很难看 default to 14.0
final
style BatteryIndicatorStyle
指示器样式,BatteryIndicatorStyle.flat为简洁样式,BatteryIndicatorStyle.skeumorphism为拟物样式 indicator style,BatteryIndicatorStyle.flat and BatteryIndicatorStyle.skeumorphism
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _BatteryIndicatorState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited