stargazing-dino / just_the_tooltip

A directional tooltip for flutter projects
https://pub.dev/packages/just_the_tooltip
MIT License
56 stars 54 forks source link

Controller Issue #78

Open DragonSlayer88 opened 1 year ago

DragonSlayer88 commented 1 year ago

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 commented 8 months ago

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

JanneckLange commented 6 months ago

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 commented 6 months ago

Duplicate of https://github.com/stargazing-dino/just_the_tooltip/issues/70