onyxsdk_pen 1.1.0 copy "onyxsdk_pen: ^1.1.0" to clipboard
onyxsdk_pen: ^1.1.0 copied to clipboard

This plugin integrates the Onyx Pen SDK into Flutter to improve e-ink responsiveness in drawing apps.

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'
    }
}

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>

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
        }
    }
}

pubspec.yaml

dependencies:
  onyxsdk_pen: ^1.0.3

lib/main.dart

// Wrap your drawable widget with the OnyxSdkPenArea widget, e.g.
OnyxSdkPenArea(
  child: GestureDetector(
    onPanUpdate: (details) {},
    child: CustomPaint(
      painter: MyPainter(points),
    ),
  ),
),

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/adil192/saber/issues/848

0
likes
0
pub points
32%
popularity

Publisher

verified publisheradil.hanney.org

This plugin integrates the Onyx Pen SDK into Flutter to improve e-ink responsiveness in drawing apps.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on onyxsdk_pen