A flutter plugin to touch and perform swipe on screen using accessibility service. This plugin was designed to go in sync with Auto Join app.
To use this plugin, add do_touch
as a dependency in your pubspec.yaml
.
Also add this service tag in your AndroidManifest.xml
file.
<service android:name="com.example.do_touch.MyAccessibilityService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
android:label="Auto Join"
android:exported="true">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_service_config" />
</service>
DoTouch.screenOn
- To check whether the screen is turned on or not.
DoTouch.isDeviceLocked
- To check whether the screen is locked or not.
isAccessibilityGranted
- Checks if accessibikity permission is granted.
if not getPermission
use this to navigate user to the consent screen.
import 'package:do_touch/do_touch.dart';
await DoTouch.touchPoint(
x: 100,
y: 100,
canSwipe: false,
);
For more detailed example see here
touchPoint
method takes 3 properties x
- x co-ordinate point of the screen, y
- y co-ordinate point of the screen, canSwipe
- boolean whether to swipe from up from that point (As of now only swipe up is implemented).
I welcome contributors to enchance this plugin. Also feel free to throw some issues if you find one.
Cheers!