Closed ghost closed 4 years ago
@IL7Games What is the error exactly?
Compiler message: lib/main.dart:35:18: Error: A value of type 'Future
' can't be assigned to a variable of type 'bool'.
- 'Future' is from 'dart:async'. Try changing the type of the left hand side, or casting the right hand side to 'bool'. if(Vibration.hasVibrator()){ ^ Compiler failed on /home/***/Documentos/Dev/Flutter/flutter_flutter/lib/main.dart
Where: Script '/home/***/.development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 765
What went wrong: Execution failed for task ':app:compileFlutterBuildDebugArm'. Process 'command '/home/***/.development/flutter/bin/flutter'' finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 37sGradle task assembleDebug failed with exit code 1
HasVibrate uses the Future class, so it has to use async to work:
void vibrate() async {
if (await Vibration.hasVibrator()){
//Vibration.vibrate();
Vibration.vibrate(duration: 100);
}
}
"Thank you" for your absence benjamindean.
"Thank you" for your absence benjamindean.
@IL7Games This is rude. You didn't pay benjamindean for his time
Yes, I was a little rude and I apologize for that @benjamindean.
You didn't pay benjamindean for his time
I know I didn't pay him anything but who made the plugin @qqgg231 ? I know he's not obligated to help me, but couldn't he give me just a little bit of help?
Anyway, I hope that with this topic can help other people with the same problem and once again I'm sorry benjamindean.
My visual code is causing an error when I put this method (has) in my code. Can you give me a hand?