Flutter SDK
Complete integration guide for the Encatch Flutter SDK — in-app feedback and survey collection for Flutter apps
The Encatch Flutter SDK lets you collect in-app feedback and surveys in Flutter apps. Display forms as a modal WebView overlay or inline in your layout, identify users, track screens and events, and submit responses to the Encatch backend.
Overview
- Package:
encatch_flutter - Version: 1.0.0
- Platforms: Android, iOS
- Repository: github.com/get-encatch/flutter-sdk
Installation
flutter pub add encatch_flutterdependencies:
encatch_flutter: ^1.0.0Quick Start
1. Initialization
Wrap your app's root widget with EncatchProvider to initialize the SDK, start a session, and mount the headless EncatchWebView listener for modal forms. No navigator key or extra WebView widget is required.
import 'package:encatch_flutter/encatch_flutter.dart';
void main() {
runApp(
EncatchProvider(
apiKey: 'your-api-key',
child: MyApp(),
),
);
}For inline forms, mount EncatchInlineForm in your screen widget tree separately.
Pass an optional EncatchConfig to customize SDK behavior:
EncatchProvider(
apiKey: 'your-api-key',
config: EncatchConfig(
theme: EncatchTheme.system,
debugMode: true,
isFullScreen: false,
apiBaseUrl: 'https://app.encatch.com',
appVersion: '1.2.3',
onBeforeShowForm: (payload) async {
// Return false to prevent form from showing
return true;
},
),
child: MyApp(),
)Prop
Type
2. Identify users
Identify the current user. The userName is required (can be a username, email, or unique identifier). Traits and options are optional.
await Encatch.identifyUser('user@example.com');await Encatch.identifyUser(
'user@example.com',
traits: UserTraits(
set: {'name': 'Alice', 'plan': 'team'},
),
);await Encatch.identifyUser(
'user@example.com',
traits: UserTraits(
set: {'name': 'Alice', 'plan': 'team'},
setOnce: {'firstSeen': DateTime.now()},
increment: {'loginCount': 1},
decrement: {'credits': 5},
unset: ['trialEndDate'],
),
);Prop
Type
User traits support the following operations:
| Operation | Description |
|---|---|
set | Set user attributes (overwrites existing values) |
setOnce | Set user attributes only if they don't already exist |
increment | Increment numeric user attributes |
decrement | Decrement numeric user attributes |
unset | Remove user attributes |
Recommended
Using the secure option with a server-generated signature is recommended to verify that identification requests come from your backend. Keep your secret key on the server only — never expose it in client-side code.
Pass a server-generated HMAC signature so Encatch can validate the request. The generatedDateTimeinUTC timestamp limits the signature's lifespan.
await Encatch.identifyUser(
'user@example.com',
options: IdentifyOptions(
secure: SecureOptions(
signature: 'your-hmac-signature',
generatedDateTimeinUTC: '2025-03-13T12:00:00Z',
),
),
);3. Show a form manually
Show a specific form by slug or ID.
await Encatch.showForm('feedback-form');
await Encatch.showForm('feedback-form', options: ShowFormOptions(
reset: ResetMode.always,
));Prop
Type
Prop
Type
| ResetMode | Behavior |
|---|---|
ResetMode.always | Reset pre-fill and response data on every form display |
ResetMode.onComplete | Reset only after the form is completed |
ResetMode.never | Never reset response data |
Pass caller context when showing a form:
await Encatch.showForm('feedback-form', options: ShowFormOptions(
reset: ResetMode.always,
context: {'plan': 'team', 'feature': 'checkout'},
));Other actions
Inline Forms
Inline forms are a way to show Encatch in-app feedback without a modal — the survey renders directly in your layout instead of as a full-screen overlay.
Build Your Own Form UX & UI
If your feedback flow uses a fixed, predictable question set — the same fields and workflow every time — you can build the form with your own Flutter widgets and submit responses through the SDK. That keeps typography, spacing, colors, and interaction patterns aligned with the rest of your app, so the survey feels like a native screen rather than an embedded web page.
Example coming soon.
Support
- pub.dev: encatch_flutter
- Issues: github.com/get-encatch/flutter-sdk/issues
Was this page helpful?