PavelS0 / docx_template_dart

A Docx template engine
Apache License 2.0
43 stars 31 forks source link

Cannot add the images inside a table #11

Closed shalika-97 closed 3 years ago

shalika-97 commented 3 years ago

If I add the images in RowContent plugin throws an exception ` List rows = [];

for(int i=0; i <report.summaryOfSightings.length; i++){
  final element = report.summaryOfSightings[i];
  // list.add();
  rows.add(
      RowContent()
        ..add(TextContent("key2", element.comment))
        ..add(ImageContent("image", element.pdfImage))
  );
}

`

E/flutter ( 1387): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'ImageContent' is not a subtype of type 'TableContent' of 'c' E/flutter ( 1387): #0 RowView.produce (package:docx_template/src/view.dart) E/flutter ( 1387): #1 ViewManager._produceInner (package:docx_template/src/view_manager.dart:106:20) E/flutter ( 1387): #2 ListView.produce (package:docx_template/src/view.dart:327:14) E/flutter ( 1387): #3 ViewManager._produceInner (package:docx_template/src/view_manager.dart:104:20) E/flutter ( 1387): #4 ViewManager.produce (package:docx_template/src/view_manager.dart:95:9) E/flutter ( 1387): #5 DocxTemplate.generate (package:docx_template/src/template.dart:27:8) E/flutter ( 1387): #6 _AddFieldReportState.save (package:flutter_template/pages/inspection/add_field_report.dart:723:26) E/flutter ( 1387): <asynchronous suspension> E/flutter ( 1387):

PavelS0 commented 3 years ago

Fixed in a864546

shalika-97 commented 3 years ago

Thank you. Its works now