justkawal / excel

Excel Library for Flutter and Dart - https://pub.dev/packages/excel
MIT License
403 stars 212 forks source link

The argument type 'String' can't be assigned to the parameter type 'ExcelColor' #335

Open Javicg10 opened 4 months ago

Javicg10 commented 4 months ago

Today I tried to compile and found multiple errors regarding backgroundColorHex:

The argument type 'String' can't be assigned to the parameter type 'ExcelColor'.

  CellStyle customCellStyle = CellStyle(
      backgroundColorHex: '#fce48e',
      bold: true,
      horizontalAlign: HorizontalAlign.Center);
esingulten commented 4 months ago

horizontalAlign doesn't work either

esingulten commented 4 months ago

ignores first line

esingulten commented 4 months ago

Today I tried to compile and found multiple errors regarding backgroundColorHex:

The argument type 'String' can't be assigned to the parameter type 'ExcelColor'.

  CellStyle customCellStyle = CellStyle(
      backgroundColorHex: '#fce48e',
      bold: true,
      horizontalAlign: HorizontalAlign.Center);

ExcelColore.red

piddval commented 4 months ago

Hi,

Same happened to me. I fixed the errors by replacing the color literal strings with ExcelColor:

backgroundColorHex: '#FFE25C', --> ExcelColor.fromHexString('#FFE25C')

Regards