Flutter_widget_from_html: Adding rowSpan and colSpan

Created on 26 Nov 2020  路  9Comments  路  Source: daohoangson/flutter_widget_from_html

Hi,

I urgently need colSpan and rowSpan support for this library. I saw that you stated I can use "flutter_layout_grid" but it's not what I'm looking for. I want to show dynamic html content in my flutter app which is retrieved from external source. So I just want to present this content and not parsing it and show it programmatically. I saw the following code in tag_table.dart:

   _cellOp ??= BuildOp(
      onWidgets: (cellMeta, widgets) {
        final column = wf
            .buildColumnPlaceholder(cellMeta, widgets)
            ?.wrapWith((_, child) => _TableCell(child));
        if (column == null) return [];

        final attributes = cellMeta.element.attributes;
        row.cells.add(_TagTableDataCell(
          child: column,
          colspan: tryParseIntFromMap(attributes, 'colspan') ?? 1,
          rowspan: tryParseIntFromMap(attributes, 'rowspan') ?? 1,
        ));

        return [column];
      },
      priority: StyleSizing.kPriority,
    );

What I see is, that you parse the colspan and rowspan and obviously set it statically to 1 - am I right? is it somehow possible to add this feature? or what are the problems there?

Thanks in advance and KR

question

All 9 comments

The latest version does support colspan / rowspan. It doesn't work for you? What is your HTML and package version?

Ok that's great news, so maybe I do something wrong with packages. We're currently using flutter_widget_from_html_core in version 0.5.1+4. And I guess I have to switch to flutter_widget_from_html in version 0.5.1+5 correct? Or do I have to have both packages installed?

Oh right. You only needs flutter_widget_from_html btw.

It works, many thanks! Fast and great support, well appreciate!

That's great, I'm closing this issue then.

Cheers.

You only needs flutter_widget_from_html btw.

But flutter_widget_from_html isn't up to date with 0.5.1+5 @daohoangson 馃槃

What do you mean? Not up to date?

@daohoangson Oh okay, thought you were refering to the core package (which is currently in v0.5.1+4). Sorry.

Ah yeah, the most recent release is enhanced only so core version wasn't bumped. Glad everything worked out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yoush97 picture yoush97  路  6Comments

ahmadkhedr picture ahmadkhedr  路  6Comments

forever84721 picture forever84721  路  4Comments

theneshofficial picture theneshofficial  路  4Comments

ahmadkhedr picture ahmadkhedr  路  6Comments