bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.

Home Page:https://pluto.weblaze.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

column title as icon

or-nayax opened this issue · comments

Hey,

I'm wondering if there is a way to set the column title as an icon, or any widget?
the main purpose is to get similar results to that

image

@or-nayax
Please refer to the code below.

PlutoColumn(
  title: 'column1',
  field: 'column1',
  type: PlutoColumnType.text(),
  width: 80,
  titleSpan: WidgetSpan(
    child: IconButton(
      icon: const Icon(Icons.settings),
      onPressed: () => print('onPressed'),
    ),
  ),
  enableContextMenu: false,
  enableSorting: false,
  titleTextAlign: PlutoColumnTextAlign.center,
  textAlign: PlutoColumnTextAlign.center,
  renderer: (PlutoColumnRendererContext rendererContext) {
    return IconButton(
      icon: const Icon(Icons.more_vert),
      onPressed: () {
        print(rendererContext.rowIdx);
      },
    );
  },
),

thanks!