LCD LED

Pub

Emulates a 7 LEDs display (well, with colon and dot also!).

Features

Screenshot

  • 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
    ),
)
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,
    ),
)

Libraries

lcd_led