Skip to content

[syncfusion_flutter_datagrid] Null check crash in RenderVirtualizingCellsWidget._getDataCellBase when long-pressing stacked header / table summary rows (resizingLine! is null) #2539

Description

@bahadirarslan

Bug description

Long-pressing certain non-data rows in SfDataGrid (stacked header row or table summary rows) triggers a fatal crash:

TypeError: Null check operator used on a null value

The crash occurs inside Syncfusion’s internal RenderVirtualizingCellsWidget._getDataCellBase when resizingLine is null, but the stacked-header / summary-row branch still force-unwraps it with resizingLine!.

This is not an application null-dereference in our callback. The grid throws before onCellLongPress can apply any row-type guard.

Steps to reproduce

  1. Create an SfDataGrid with:
    • stackedHeaderRows (non-empty)
    • tableSummaryRows with GridTableSummaryRowPosition.bottom (we use three summary rows: page totals, previous page totals, grand total)
    • onCellLongPress callback wired (optional for repro — crash is internal)
  2. Load enough rows that summary rows render.
  3. Long-press on:
    • a stacked header cell, or
    • a table summary row cell (bottom summary area)
  4. Observe crash.

Expected behavior

  • Long-press on stacked header / summary rows should either:
    • be ignored safely, or
    • invoke onCellLongPress with a well-defined DataGridCellLongPressDetails (or not start a long-press at all)
  • No crash when resizingLine cannot be resolved for non-standard row types.

Actual behavior

Fatal exception during long-press handling inside the grid renderer.

Code sample

Code sample

Minimal configuration (representative)

SfDataGrid(
  source: myDataSource,
  stackedHeaderRows: stackedHeaderRows,
  tableSummaryRows: [
    GridTableSummaryRow(
      title: 'pageTotals',
      showSummaryInRow: false,
      columns: summaryColumns,
      position: GridTableSummaryRowPosition.bottom,
    ),
    GridTableSummaryRow(
      title: 'total',
      showSummaryInRow: false,
      columns: summaryColumns,
      position: GridTableSummaryRowPosition.bottom,
    ),
  ],
  onCellLongPress: (details) {
    // Never reached when long-pressing summary/header rows
  },
  columns: columns,
)

Screenshots or Video

no screenshots can provided now

Stack Traces

Stack Traces
LongPressGestureRecognizer._checkLongPressStart
  → RenderVirtualizingCellsWidget._onLongPressStart (rendering_widget.dart:1590)
  → RenderVirtualizingCellsWidget._getDataCellBase (rendering_widget.dart:1534)
  → RenderVirtualizingCellsWidget._getDataCellBase.<T> (rendering_widget.dart:1540)

TypeError: Null check operator used on a null value

On which target platforms have you observed this bug?

iOS

Flutter Doctor output

Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.41.9, on macOS 26.5.1 25F80 darwin-arm64, locale en-TR) [1,090ms]
    • Flutter version 3.41.9 on channel stable at /Users/bahadirarslan/Development/SDKS/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 00b0c91f06 (7 weeks ago), 2026-04-29 10:03:19 -0700
    • Engine revision 42d3d75a56
    • Dart version 3.11.5
    • DevTools version 2.54.2
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
      omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    data gridData grid componentsolvedSolved the query using existing solutions

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions