Skip to content

Duplicate GolbalKey #3

@PremchandGat

Description

@PremchandGat

The following assertion was thrown while finalizing the widget tree:
Duplicate GlobalKey detected in widget tree.

The following GlobalKey was specified multiple times in the widget tree. This will lead to parts of the widget tree being truncated unexpectedly, because the second time a key is seen, the previous instance is moved to the new location. The key was:
I am getting this error

  • [LabeledGlobalKey#cbd4d]
    This was determined by noticing that after the widget with the above global key was moved out of its previous parent, that previous parent never updated during this frame, meaning that it either did not update at all or updated before the widget was moved, in either case implying that it still thinks that it should have a child with that global key.
    The specific parent that did not update after having one or more children forcibly removed due to GlobalKey reparenting is:
  • _EffectiveTickerMode(effective mode: enabled)
    A GlobalKey can only be specified on one widget at a time in the widget tree.
    When the exception was thrown, this was the stack:
    #0 BuildOwner.finalizeTree. (package:flutter/src/widgets/framework.dart:3083:15)
    manage button loading state from outside #1 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3108:8)
    Automatically inherit the theme from context #2 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:866:19)
    Duplicate GolbalKey #3 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:381:5)
    how to set disabled style #4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289:15)
    error: AnimationController.reverse() called after AnimationController.dispose() #5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1218:9)
    #6 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1076:5)
    #7 _invoke (dart:ui/hooks.dart:145:13)
    #8 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
    #9 _drawFrame (dart:ui/hooks.dart:112:31)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions