Add All the files from the touchpad_demonstrator Flutter App which can be build for Android and iOS
This commit is contained in:
Executable
+1
@@ -0,0 +1 @@
|
||||
enum buttonsState{pressed,released}
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
|
||||
// The base class for the different types of items the List can contain
|
||||
|
||||
abstract class ListItem {}
|
||||
|
||||
class TouchData implements ListItem {
|
||||
int event;
|
||||
int fingerNumber;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
TouchData(this.event, this.fingerNumber, this.x, this.y);
|
||||
|
||||
void touchEvent(int E, int X, int Y) {
|
||||
this.event = E;
|
||||
this.x = X;
|
||||
this.y = Y;
|
||||
}
|
||||
}
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:vibrate/vibrate.dart';
|
||||
|
||||
bool canVibrate = false;
|
||||
|
||||
void vibrate(FeedbackType feedbackType) async{
|
||||
canVibrate = await Vibrate.canVibrate;
|
||||
print('_vibrate');
|
||||
if (canVibrate) {
|
||||
print('vibrate -- type: $feedbackType');
|
||||
Vibrate.feedback(feedbackType);
|
||||
}
|
||||
}
|
||||
|
||||
void vibrateDelayed(FeedbackType feedbackType, Duration duration) async{
|
||||
canVibrate = await Vibrate.canVibrate;
|
||||
Future.delayed(duration,()
|
||||
{
|
||||
print('_vibrate');
|
||||
if (canVibrate) {
|
||||
print('vibrate -- type: $feedbackType');
|
||||
Vibrate.feedback(feedbackType);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user