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

Showcase.withwidget always gives me Null check operator used on a null value #196

Closed
mhilalsh opened this issue Mar 3, 2022 · 5 comments

Comments

@mhilalsh
Copy link

mhilalsh commented Mar 3, 2022

I'm trying to use the Showcase.withwidget to create a container because I want to add a skip button to the showcase, but every time I try to use the showcase.withwidget I get "Null check operator used on a null value",
my code snippet :

Showcase.withWidget(
key: _one,
shapeBorder: CircleBorder(),
container: Container(
height: 200,
width: 200,
child: Row(
children: [
Text("..."),
ElevatedButton(onPressed: (){
ShowCaseWidget.of(context).dismiss();
}, child: Text("skip"))
],
),
),
child: _customDropDownMenu,
),

@mhilalsh
Copy link
Author

mhilalsh commented Mar 3, 2022

Hi @vatsaltanna can you help me with this, please?

@BirjuVachhani
Copy link
Contributor

@mhilalsh Can you please share stacktrace?

@mhilalsh
Copy link
Author

mhilalsh commented Mar 5, 2022

@BirjuVachhani sorry for the late response,
here's my stacktrace :

======== Exception caught by widgets library =======================================================
The following _CastError was thrown building ToolTipWidget(dirty, dependencies: [_EffectiveTickerMode], state: _ToolTipWidgetState#559ef(ticker active)):
Null check operator used on a null value

The relevant error-causing widget was:
MaterialApp MaterialApp:file:///.../lib/main.dart:14:14
When the exception was thrown, this was the stack:
#0 _ToolTipWidgetState._getSpace (package:showcaseview/src/tooltip_widget.dart:168:68)
#1 _ToolTipWidgetState.build (package:showcaseview/src/tooltip_widget.dart:356:19)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:4705:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4588:15)
#4 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4763:11)
#5 Element.rebuild (package:flutter/src/widgets/framework.dart:4311:5)
#6 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4566:5)
#7 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4754:11)
#8 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4561:5)
#9 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3631:14)
#10 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6261:36)
#11 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6272:32)
#12 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3631:14)
#13 Element.updateChild (package:flutter/src/widgets/framework.dart:3380:20)
#14 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4613:16)
#15 Element.rebuild (package:flutter/src/widgets/framework.dart:4311:5)
#16 ProxyElement.update (package:flutter/src/widgets/framework.dart:4943:5)
#17 Element.updateChild (package:flutter/src/widgets/framework.dart:3370:15)
#18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4613:16)
#19 Element.rebuild (package:flutter/src/widgets/framework.dart:4311:5)
#20 StatelessElement.update (package:flutter/src/widgets/framework.dart:4669:5)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:3370:15)
#22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4613:16)
#23 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4763:11)
#24 Element.rebuild (package:flutter/src/widgets/framework.dart:4311:5)
#25 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2578:33)
#26 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#27 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5)
#28 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1145:15)
#29 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9)
#30 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996:5)
#34 _invoke (dart:ui/hooks.dart:150:10)
#35 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#36 _drawFrame (dart:ui/hooks.dart:114:31)
(elided 3 frames from dart:async)

@mhilalsh
Copy link
Author

mhilalsh commented Mar 5, 2022

@BirjuVachhani @vatsaltanna FYI Showcase.withWidget throws this exception when I try to wrap a custom widget in it like this custom drop down menu it's a separated widget that I created and included in my login page, but it works fine if I try to wrap any other normal widgets in it.

@mhilalsh
Copy link
Author

mhilalsh commented Mar 7, 2022

it worked with me I guess my problem was in the parameters that I gave to the showcase.withwidget here's my code :
Showcase.withWidget(
key: _one,
width: double.infinity,
height: 150,
container: Container(
width: MediaQuery.of(context).size.width - 24,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'...'),
),
TextButton(
onPressed: _skipShowCase,
child: Text('Skip Tutorial'),
)
],
),
),
child: _customDropDownMenu,
),

@mhilalsh mhilalsh closed this as completed Mar 7, 2022
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

2 participants