Beta — installed from GitHub. During the beta you add the plugin as a git dependency
and build its Android half locally once. When we publish to pub.dev and Maven
Central, both steps collapse into a single
flutter pub add learnink_sdk. See
Overview.Prerequisites
- Flutter 3.10 or newer (
flutter --version) - JDK 17 or newer for the Android build
- Your app’s
minSdkVersionis 21 or higher - A backend endpoint that returns a LearnInk sign-in token — see Step 1 of the WebView setup guide
- Your org ID
- Access to github.com/LearnInkTeam/learnink-sdk
The SDK targets Android. On other platforms the widget renders a short message in
place of the LearnInk experience, so a shared codebase still builds and runs.
1
Build the SDK's Android half
The Flutter plugin wraps a native Android library, which you build once on your machine:You should see
BUILD SUCCESSFUL.Build fails with 'Gradle requires JVM 17 or later'
Build fails with 'Gradle requires JVM 17 or later'
Your default JDK is too old:If
flutter build later fails the same way, point Flutter at a modern JDK once:2
Add the plugin to your pubspec
pubspec.yaml
ref: v0.1.0 pins you to a specific release. Without it you track main, and your
teammates may silently get different code.3
Let your app find the native library
Your app’s Android build needs to resolve the library you published in Step 1. In
android/build.gradle (or android/build.gradle.kts) add mavenLocal():android/build.gradle
Newer Flutter templates may not have an
allprojects block. If yours doesn’t, add one —
it goes at the top level of android/build.gradle.4
Write your token function
Create a function that calls your backend and returns the token string. This example
uses the
http package:5
Show the LearnInk widget
LearnInkWebView is an ordinary widget — put it wherever you like:The widget fills whatever space its parent gives it. Inside a
Column or Row, wrap it in
Expanded, or it will have zero height and render nothing.6
Verify it works
Run on an Android device or emulator. You should see:
- ✅ A brief loading indicator, then LearnInk content
- ✅ No login screen — the user is signed in automatically
- ✅ Tapping close inside LearnInk pops the route
Controlling the view
Capture a controller to drive the widget after it is built:Widget reference
Next steps
Offline behaviour
What your app must show when a user has no connection and nothing downloaded.
Push notifications
Still required — the SDK does not change how notifications reach users.