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

Null check operator used on a null value. Error thrown null #82

Open
raunak-moonraft opened this issue Aug 9, 2021 · 5 comments
Open

Comments

@raunak-moonraft
Copy link

@RafaelBarbosatec
This same issue is happening with me as well. We are using tutorial_coach_mark: ^1.0.3 (the latest version at present). Here is the crashlytics issue: -

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown null.
at TutorialCoachMark.show.(tutorial_coach_mark.dart:80)
at _CustomZone.bindCallback.(dart:async)
at TickerFuture.whenCompleteOrCancel.thunk(ticker.dart:407)

Device OS Android 11

@RafaelBarbosatec
Copy link
Owner

Hi @raunak-moonraft !
Thanks for report this issue!
Try use 1.1.1 version.

@rohan20
Copy link

rohan20 commented Oct 24, 2022

Running into the same issue. v1.2.4

======== Exception caught by widgets library =======================================================
The following _CastError was thrown building TutorialCoachMarkWidget-[LabeledGlobalKey<TutorialCoachMarkWidgetState>#02fec](dirty, state: TutorialCoachMarkWidgetState#e37a7):
Null check operator used on a null value

The relevant error-causing widget was: 
  Navigator-[LabeledGlobalKey<NavigatorState>#df031] Navigator:file:///Users/redacted/Dev/redacted-project-name/lib/core/navigation/navigation_widget.dart:82:20
When the exception was thrown, this was the stack: 
#0      TutorialCoachMarkWidgetState._buildContents (package:tutorial_coach_mark/src/widgets/tutorial_coach_mark_widget.dart:150:39)
#1      TutorialCoachMarkWidgetState.build (package:tutorial_coach_mark/src/widgets/tutorial_coach_mark_widget.dart:105:20)
#2      StatefulElement.build (package:flutter/src/widgets/framework.dart:4992:27)
#3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4878:15)
#4      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
#5      Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
#6      StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
#7      Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
#8      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)

It probably has something to do with the Navigator widget that I'm using in my app.

The transition appears correctly but then results in the NPE right at the end.

@rohan20
Copy link

rohan20 commented Oct 24, 2022

My bad. The issue was that I was initialising targets inside the build method instead of doing it just once in the initState method as the README rightly points out.

@ivanhercaz
Copy link

@RafaelBarbosatec, I had this problem following the available example and I solved it following @rohan20 suggestion. May it be necessary to update the example?

@RafaelBarbosatec
Copy link
Owner

HI @ivanhercaz !
Yes, you need run the tutorial after you tree widgets already rendered.

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

4 participants