How to change the chart line color to custom color code value in Flutter

I am new to flutter and was also facing the same issue, So, as far as I came to know is that may be we cant use the MaterialColor for the charts Color and So a workaround to this was to replace your charts.MaterialPalette.lime.shadeDefault code with charts.Color.fromHex(code: '#f2f2f2').

This was discussed in this GitHub issue.


Dart colors can be used with ColorUtil method

color: charts.ColorUtil.fromDartColor(Colors.white),

You can set

seriesColor: charts.ColorUtil.fromDartColor(Colors.blue.shade700),

for example.