Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller Issue #78

Open
DragonSlayer88 opened this issue Aug 14, 2023 · 3 comments
Open

Controller Issue #78

DragonSlayer88 opened this issue Aug 14, 2023 · 3 comments

Comments

@DragonSlayer88
Copy link

Im dynamically attaching controllers to tooltips i am creating as i need them. The first ones i create work fine, but when i create more i get this error. Please help:

Bad state: This controller has not been attached to a tooltip yet.

@guchengxi1994
Copy link

same issue, but only happens after i press "r" to hot reload.

@JanneckLange
Copy link

I use the tooltip for Markers on the FlutterMap.
This happened on some Markers. I couldn't find a pattern.

Even on the first time, simulator and real device. No reload required

═══════ Exception caught by gesture ═══════════════════════════════════════════
The following StateError was thrown while handling a gesture:
Bad state: This controller has not been attached to a tooltip yet.

When the exception was thrown, this was the stack:
#0      JustTheController.defaultShowTooltip (package:just_the_tooltip/src/models/just_the_controller.dart:22:5)
just_the_controller.dart:22
 ...locationss.entries.map((entry) {
      final tooltipController = JustTheController();
      return Marker(
        width: 25.0,
        height: 25.0,
        point: entry.value,
        builder: (ctx) => GestureDetector(
          onTap: () => {
            tooltipController.showTooltip(immediately: true)
          },
          child: JustTheTooltip(
            controller: tooltipController,
            content: Padding(
              padding: const EdgeInsets.all(8.0),
              child: ConstrainedBox(
                  constraints:
                      const BoxConstraints(maxWidth: 200.0),
                  child: Text(
                    '${member.vorname} ${member.nachname}',
                  )),
            ),
            child: Icon(
              Icons.person_pin_circle,
              color: Colors.red,
            ),
          ),
        ),
      );
});

@JanneckLange
Copy link

Duplicate of #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants