Skip to content

Tooltip in TableRow gives render error #177038

Description

@edDemDev

Steps to reproduce

Using https://api.flutter.dev/flutter/widgets/Table-class.html I wanted to create a table with a sticky header with a tooltip.
To simulate this I created two table widgets, one for the header and one for the content (which would be scrollable).
On the header I had to add a tooltip and while I was testing I found this strange behaviour.

Expected results

Tooltip message shown with no error.

Actual results

After pressing the tooltip the console displayed the following error: RangeError (length): Invalid value: Only valid value is 0: 1
The error occurs specifically in RenderTable.assembleSemanticsNode at line 687, suggesting this is related to Flutter's accessibility/semantics system not properly handling tooltips in single-row tables.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const TableExampleApp());
}

class TableExampleApp extends StatelessWidget {
  const TableExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Table Sample')),
        body: Column(children: [
          _TableHeader(),
          _TableBody(),
        ],),
      ),
    );
  }
}

class _TableHeader extends StatelessWidget {
  const _TableHeader({super.key});

  @override
  Widget build(BuildContext context) {
    return Table(
      border: TableBorder.all(),
      columnWidths: const <int, TableColumnWidth>{
        0: FlexColumnWidth(),
        1: FlexColumnWidth(),
        2: FlexColumnWidth(),
      },
      defaultVerticalAlignment: TableCellVerticalAlignment.middle,
      children: <TableRow>[
        TableRow(
          children: <Widget>[
            Row(children: [Text('Header 1', style: TextStyle(fontSize: 24)), Tooltip(message: 'Tooltip 1', child: Icon(Icons.info))]),
            Text('Header 2', style: TextStyle(fontSize: 24)),
            Text('Header 3', style: TextStyle(fontSize: 24)),
          ],
        ),
      ],
    );
  }
}

class _TableBody extends StatelessWidget {
  const _TableBody({super.key});

  @override
  Widget build(BuildContext context) {
    return Table(
      border: TableBorder.all(),
      columnWidths: const <int, TableColumnWidth>{
        0: FlexColumnWidth(),
        1: FlexColumnWidth(),
        2: FlexColumnWidth(),
      },
      defaultVerticalAlignment: TableCellVerticalAlignment.middle,
      children: <TableRow>[
        TableRow(
          children: <Widget>[
            Text('Body 1', style: TextStyle(fontSize: 24)),
            Text('Body 2', style: TextStyle(fontSize: 24)),
            Text('Body 3', style: TextStyle(fontSize: 24)),
          ],
        ),
                TableRow(
          children: <Widget>[
            Text('Body 1', style: TextStyle(fontSize: 24)),
            Text('Body 2', style: TextStyle(fontSize: 24)),
            Text('Body 3', style: TextStyle(fontSize: 24)),
          ],
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following RangeError was thrown during a scheduler callback:
RangeError (length): Invalid value: Only valid value is 0: 1

When the exception was thrown, this was the stack:
#0      List.[] (dart:core-patch/growable_array.dart)
#1      RenderTable.assembleSemanticsNode (package:flutter/src/rendering/table.dart:687:19)
#2      _RenderObjectSemantics._buildSemanticsSubtree (package:flutter/src/rendering/object.dart:5918:20)
#3      _RenderObjectSemantics.ensureSemanticsNode (package:flutter/src/rendering/object.dart:5847:7)
#4      PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1493:25)
#5      PipelineOwner.flushSemantics (package:flutter/src/rendering/object.dart:1501:15)
#6      RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:636:25)
#7      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1261:13)
#8      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
#9      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1434:15)
#10     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1347:9)
#11     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1200:5)
#12     _invoke (dart:ui/hooks.dart:330:13)
#13     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
#14     _drawFrame (dart:ui/hooks.dart:302:31)
════════════════════════════════════════════════════════════════════════════════════════════════════

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.5, on macOS 15.7.1 24G231 darwin-arm64, locale en-PT) [809ms]
    • Flutter version 3.35.5 on channel stable at /Applications/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ac4e799d23 (3 weeks ago), 2025-09-26 12:05:09 -0700
    • Engine revision d3d45dcf25
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [3.7s]
    • Android SDK at /Users/user/Library/Android/sdk
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [2.3s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A400
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [8ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2025.1) [8ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)

[✓] Connected device (4 available) [7.0s]
    • iPhone 17 Pro (mobile)       • 65C94B6D-E5BB-46D4-A479-BDC0DE13D1D2 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
    • iPad mini (A17 Pro) (mobile) • AF44E666-99FE-45A6-9F09-406F1B9483CB • ios            • com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
    • macOS (desktop)              • macos                                • darwin-arm64   • macOS 15.7.1 24G231 darwin-arm64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 141.0.7390.67

[✓] Network resources [430ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworkc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type
    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