benjamindean/flutter_vibration

bool operator for hasVibrator

Closed this issue · 2 comments

i get an error when i try this:

               if (Vibration.hasVibrator()) {
				Vibration.vibrate(duration: 500);
				return true;
		}

saying

Conditions must have a static type of 'bool'.
Try changing the condition.

All the methods are Futures. Meaning, you should await them. You can always check it by checking the function return type. I released a new version with updated README.

Ok Benjamin, thanks. Will try that now.