Skip to content

[url_launcher]Error: setState() called after dispose(): _PlatformViewLinkState#946fb(lifecycle state: defunct, not mounted) #102741

Closed
flutter/plugins
#5963
@kristoffer-zliide

Description

@kristoffer-zliide

onPlatformViewCreated calls setState(), so it probably shouldn't be called indiscriminately after an async operation. Or, maybe onPlatformViewCreated shouldn't call setState without checking mounted state.

Easily reproducible by making a large list of widgets with Links and scroll through it.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.22000.613], locale en-DK)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.9.4)
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.2)
[✓] VS Code, 64-bit edition
[✓] Connected device (4 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworkfound in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions