Last updated:
0 purchases
onyxsdk pen
onyxsdk_pen #
This plugin integrates the
Onyx Pen SDK
into Flutter to improve e-ink performance in drawing apps.
Most of the SDK functionality is omitted due to it being restricted to Onyx devices.
We instead only provide the OnyxSdkPenArea widget. The children of this widget
(typically including a CustomPaint and GestureDetector)
will automatically gain fluid pen strokes.
You are responsible for taking user input and drawing it. The
OnyxSdkPenArea widget will just make things faster on Onyx devices.
When used on devices that aren't Onyx Android devices, the OnyxSdkPenArea widget will
just return its child.
Getting Started #
Android #
See this commit
for an example of the following setup...
android/app/build.gradle
android {
defaultConfig {
// Onyx SDK requires 23 or higher
minSdkVersion 23
}
packagingOptions {
pickFirst 'lib/*/libc++_shared.so'
pickFirst 'androidsupportmultidexversion.txt'
}
}
copied to clipboard
android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.adilhanney.saber">
<!-- Add this `tools:replace` attribute to the `application` tag -->
<application
tools:replace="android:label">
</application>
</manifest>
copied to clipboard
In my case, I got a compiler error saying that I needed tools:replace="android:allowBackup"
so I merged the two with tools:replace="android:label,android:allowBackup".
android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
// Add these two lines
maven {
url "https://jitpack.io"
}
maven {
url "http://repo.boox.com/repository/maven-public/"
allowInsecureProtocol true
}
}
}
copied to clipboard
pubspec.yaml
dependencies:
onyxsdk_pen: ^1.0.3
copied to clipboard
lib/main.dart
// Wrap your drawable widget with the OnyxSdkPenArea widget, e.g.
OnyxSdkPenArea(
child: GestureDetector(
onPanUpdate: (details) {},
child: CustomPaint(
painter: MyPainter(points),
),
),
),
copied to clipboard
You can optionally run the init method in the main function of your app to
initialize the Onyx SDK. This is not required, but it will improve initial
performance on non-Onyx Android devices.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await OnyxSdkPenArea.init();
runApp(MyApp());
}
copied to clipboard
Help wanted #
I no longer have an Onyx device, so I can't really develop this plugin any further.
If you are able to, we're looking for help with this feature:
https://github.com/saber-notes/saber/issues/848
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.