Skip to content

Null check operator used on a null value; #0 State.context (package:flutter/src/widgets/framework.dart:916)#1 _TooltipState._createNewEntry #95851

@krll-kov

Description

@krll-kov

Unfortunately i can not give you any reproducible code because this error is caught by runZonedGuarded(error; stackTrace) method and reported to application's server. I've tried to recreate it myself but i have no idea how it appears. I notice these error reports since flutter 2.2.3

Null check operator used on a null value; 
#0      State.context (package:flutter/src/widgets/framework.dart:916)
#1      _TooltipState._createNewEntry (package:flutter/src/material/tooltip.dart:535)
#2      _TooltipState.ensureTooltipVisible (package:flutter/src/material/tooltip.dart:517)
#3      _rootRun (dart:async/zone.dart:1420)
#4      _CustomZone.run (dart:async/zone.dart:1328)
#5      _CustomZone.runGuarded (dart:async/zone.dart:1236)
#6      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276)
#7      _rootRun (dart:async/zone.dart:1428)
#8      _CustomZone.run (dart:async/zone.dart:1328)
#9      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1260)
#10     SemanticsConfiguration._addArgumentlessAction.<anonymous closure> (package:flutter/src/semantics/semantics.dart:3249)
#11     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395)
#12     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426)
#13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192)

This is the way i make tooltip visible:

final GlobalKey<State<Tooltip>> _toolTipKey = GlobalKey<State<Tooltip>>();
final dynamic tooltip = _toolTipKey.currentState;
if(mounted && _toolTipKey.currentState?.mounted != null) {
  tooltip?.ensureTooltipVisible();
}

Platform: Windows, Flutter version: 2.8.1 from stable channel

Metadata

Metadata

Assignees

Labels

a: error messageError messages from the Flutter frameworka: null-safetySupport for Dart's null safety featurec: crashStack traces logged to the consolef: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions