doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
18 stars 20 forks source link

[Feature] Conditional formatting for cells #45

Open Dario-Ciceri opened 2 months ago

Dario-Ciceri commented 2 months ago

Hello, would be possible to dynamically change cells background color on conditional values? Example from excel: image

Currently I'm usign:

        if (rendererContext.cell.value <= 10) {
          return Container(
            constraints: BoxConstraints.expand(),
            color: Colors.red,
            child: Text(
              "${rendererContext.cell.value}",
              style: TextStyle(color: Colors.black),
            ),
          );
        }
        return Container(
          child: Text(
            "${rendererContext.cell.value}",
            style: TextStyle(color: Colors.black),
          ),
        );
      }

It would be nice to have something like conditions [if (cell.value < 5) then cell.color = Colors.red etc...]

thanks!