Last updated:
0 purchases
lcd led
LCD LED #
Emulates a 7 LEDs display (well, with colon and dot also!).
Features #
display numbers, dots, colon, and minus chars
customizable colors
Usage #
Case 1 (fixed overall size)
Give the LedDigits widget a fixed size.
If the numberOfLeds > string.length, the widget will align the digits to the right.
SizedBox(
width: 500,
height: 70,
child: LedDigits(
string: '-12.3:',
numberOfLeds: 6,
spacing: 5,
backgroundColor: Colors.black, // default value
onColor: Colors.red, // default value
offColor: Color.fromARGB(255, 49, 49, 49), // default value
),
)
copied to clipboard
Case 2 (fixed height)
If you want a fixed height and a dynamic width, use something like the below code:
SizedBox(
height: 70,
child: AspectRatio(
aspectRatio: n.length.toDouble()/1.5, // the LEDs width will be half the `SizedBox` height
child: LedDigits(
string: n,
numberOfLeds: n.length,
),
)
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.