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

Null safety issue #52

Closed ghost closed 2 years ago

ghost commented 2 years ago

I'm getting this error while building my app:


ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:329:27: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:           RendererBinding.instance!.mouseTracker.mouseIsConnected;
ERROR:                           ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:393:21: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:     RendererBinding.instance!.mouseTracker
ERROR:                     ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:397:20: Warning: Operand of null-aware operation '!' has type 'GestureBinding' which excludes null.
ERROR:  - 'GestureBinding' is from 'package:flutter/src/gestures/binding.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/binding.dart').
ERROR:     GestureBinding.instance!.pointerRouter.addGlobalRoute(_handlePointerEvent);
ERROR:                    ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:402:21: Warning: Operand of null-aware operation '?.' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:     RendererBinding.instance?.mouseTracker
ERROR:                     ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:404:20: Warning: Operand of null-aware operation '?.' has type 'GestureBinding' which excludes null.
ERROR:  - 'GestureBinding' is from 'package:flutter/src/gestures/binding.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/binding.dart').
ERROR:     GestureBinding.instance?.pointerRouter
ERROR:                    ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:414:25: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:         RendererBinding.instance!.mouseTracker.mouseIsConnected;
ERROR:                         ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:498:22: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:       WidgetsBinding.instance?.addPostFrameCallback((_) async {
ERROR:                      ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip_entry.dart:210:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:     WidgetsBinding.instance?.addPostFrameCallback((_) {
ERROR:                    ^
Bes79 commented 2 years ago

Same issue

nodahikaru commented 2 years ago

Same issue

I'm getting this error while building my app:


ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:329:27: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:           RendererBinding.instance!.mouseTracker.mouseIsConnected;
ERROR:                           ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:393:21: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:     RendererBinding.instance!.mouseTracker
ERROR:                     ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:397:20: Warning: Operand of null-aware operation '!' has type 'GestureBinding' which excludes null.
ERROR:  - 'GestureBinding' is from 'package:flutter/src/gestures/binding.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/binding.dart').
ERROR:     GestureBinding.instance!.pointerRouter.addGlobalRoute(_handlePointerEvent);
ERROR:                    ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:402:21: Warning: Operand of null-aware operation '?.' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:     RendererBinding.instance?.mouseTracker
ERROR:                     ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:404:20: Warning: Operand of null-aware operation '?.' has type 'GestureBinding' which excludes null.
ERROR:  - 'GestureBinding' is from 'package:flutter/src/gestures/binding.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/binding.dart').
ERROR:     GestureBinding.instance?.pointerRouter
ERROR:                    ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:414:25: Warning: Operand of null-aware operation '!' has type 'RendererBinding' which excludes null.
ERROR:  - 'RendererBinding' is from 'package:flutter/src/rendering/binding.dart' ('/opt/flutter/packages/flutter/lib/src/rendering/binding.dart').
ERROR:         RendererBinding.instance!.mouseTracker.mouseIsConnected;
ERROR:                         ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip.dart:498:22: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:       WidgetsBinding.instance?.addPostFrameCallback((_) async {
ERROR:                      ^
ERROR: ../../.pub-cache/hosted/pub.dartlang.org/just_the_tooltip-0.0.11+2/lib/src/just_the_tooltip_entry.dart:210:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:     WidgetsBinding.instance?.addPostFrameCallback((_) {
ERROR:                    ^

@spiralw You can this https://pub.dev/packages/just_their_tooltip

stargazing-dino commented 2 years ago

I'm really sorry all!

Been dealing with some work stuff and had notifications turned off for most of my flutter packages until recently. I'll get back on track of this repo soon and I'll also add a note to the readme for other possible contributors so this package doesn't fall into the same rut. In meantime @phamconganh wrote a fix for these issues and I hope to release that version this weekend once I've tested it and added some more tests

Bes79 commented 2 years ago

are there any fixes?

stargazing-dino commented 2 years ago

I just uploaded v0.0.12 to pub which should be null issue free.

I really want to fix how we do controllers before I land a major v1.0 release but I dunno if I'll have time. Anyways, I'm looking for a reliable contributor to add to the project and have added a note to bottom of readme as well so hopefully the long silence won't happen again!