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 called on null Value #66

Closed
umersaddiq opened this issue Feb 21, 2022 · 3 comments
Closed

Null check operator called on null Value #66

umersaddiq opened this issue Feb 21, 2022 · 3 comments

Comments

@umersaddiq
Copy link

umersaddiq commented Feb 21, 2022

On Vibration.vibrate() it throws a message null check operator called on null value

Flutter Version 2.8.1
Dart Version 2.15.1

@benjamindean
Copy link
Owner

Can you, please, provide an example? And remember that the plugin only supports async calls.

@dVeki
Copy link

dVeki commented Jul 12, 2022

I had the same issue on my web project using flutter null safety.
This is the code used for solution:
try { bool? hasVibration = await Vibration.hasVibrator(); if (hasVibration != null && hasVibration) { bool? hasCustomVibration = await Vibration.hasCustomVibrationsSupport(); if (hasCustomVibration != null && hasCustomVibration) { await Vibration.vibrate(duration: c.duration!); } else { await Vibration.vibrate(); } } }...

@benjamindean
Copy link
Owner

Should be solved in the latest version.

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