flutter_touch_interaction_controller

Last updated:

0 purchases

flutter_touch_interaction_controller Image
flutter_touch_interaction_controller Images
Add to Cart

Description:

flutter touch interaction controller

Flutter Touch Interaction Controller #


Description: A Flutter plugin to detect and handle touch events on the screen for Android device.
Technology stack: Flutter plugin.
Status: CHANGELOG.

Main Features #

One-touch event recognition and stream provision.
Requesting accessibilityService permission.
Verifying accessibilityService permission.
One-touch execution.
Touch swife execution.

Screenshot: Sample screenshot of the project,

Installation #
Add dependencies #
Add the following dependency to your pubspec.yaml file:
dependencies:
flutter_touch_interaction_controller: ^1.1.0
copied to clipboard
Change Android settings #

Add the following code after the activity section in the android/app/src/main/AndroidManifest.xml file:

<service
android:name="com.rabbitson87.flutter_touch_interaction_controller.AccessibilityServicePlugin"
android:exported="true"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_service_config" />
</service>
copied to clipboard

Create android/app/src/main/res/xml/accessibility_service_config.xml file and add the following code:

<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFeedbackType="feedbackSpoken"
android:accessibilityFlags="flagDefault"
android:canPerformGestures="true"
android:canRequestTouchExplorationMode="true"
android:notificationTimeout="100" />
copied to clipboard
Usage #
Check if the accessibility permission is enabled:
bool isAccessibilityPermissionEnabled = await FlutterTouchInteractionController.isAccessibilityPermissionEnabled;
copied to clipboard
Request accessibility permission:
await FlutterTouchInteractionController.requestAccessibilityPermission;
copied to clipboard
Listen to the touch events:
final accessStream = FlutterTouchInteractionController.accessStream.listen((event) {
print(event);
});
copied to clipboard
Remove the listener when it is no longer needed:
accessStream.cancel();
copied to clipboard
Execute a touch event:
await FlutterTouchInteractionController.touch(Point(x: 350, y: 400));
copied to clipboard
Execute a swipe event:
await FlutterTouchInteractionController.swipe(Point(x: 350, y: 1400), Point(x: 350, y: 1000));
copied to clipboard
Getting help #
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
Getting involved #
General instructions on how to contribute should be stated with a link to CONTRIBUTING.

Open source licensing info #

TERMS
LICENSE


Credits and references #

flutter_accessibility_service
do-touch

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.