rickypid / flutter_expandable_table

A Flutter widget for create an expandable table with header and first column fixed.
https://pub.dev/packages/flutter_expandable_table
BSD 3-Clause "New" or "Revised" License
40 stars 28 forks source link

Cannot dynamically update table contents #34

Open laterdayi opened 5 months ago

laterdayi commented 5 months ago

Cannot dynamically update table contents

ExpandableTableCell _buildCell(String content, {CellBuilder? builder}) {
    return ExpandableTableCell(
      child: builder != null
          ? null
          : GestureDetector(
              onTap: () {
                print('Cell $content tapped');
                // update cell content
                setState(() {
                  data['rows'][0]['columns'][0]['value'] = 'Updated';
                });
              },
              child: DefaultCellCard(
                child: Center(
                  child: Text(
                    content,
                    style: textStyle,
                  ),
                ),
              ),
            ),
      builder: builder,
    );
  }
wajipu commented 1 week ago

How can you update it