Skip to main content
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.
By the end of this guide, tapping a button in your app opens LearnInk with the user already signed in.

Prerequisites

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.
Every developer on your team must run this once, and so must your CI runner. This step disappears when we publish to Maven Central.
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
Then:
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:
Never call the LearnInk Identify API directly from your app. That would put your API key on user devices, where it can be extracted. Your app calls your backend; your backend holds the key.
5

Show the LearnInk widget

LearnInkWebView is an ordinary widget — put it wherever you like:
Navigate to it however you normally would:
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
If you see a login screen, the token did not reach LearnInk — see Troubleshooting.

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.