Skip to main content
Requires lerix_flutter 0.4.0 or later. Everything on this page works on iOS, Android, macOS, Windows and the web. For what each module does and what you see in the dashboard, read Feedback, NPS surveys and Analytics.

Setup

Two additions to the app you set up in Installation:
  1. Put LerixFeedback above your MaterialApp. It hosts the feedback flow and the NPS sheet, and costs nothing while they’re closed.
  2. Add LerixNavigatorObserver to your navigator so screen views are recorded.
main.dart
With go_router, pass the observer to GoRouter instead:

Init options

Lerix.init takes two optional parameters for these modules:

In-app feedback

Open the flow from anywhere below LerixFeedback, for example from a “Send feedback” button:
The app shrinks into a backdrop and keeps its state. The user writes a message, picks labels, captures screenshots by navigating the app and tapping Capture, draws on them (4 colours, 3 sizes, undo and redo), adds an email and reviews Show details. The screenshot step is hidden when the renderer can’t capture the screen. show() returns a LerixFeedbackResult:

Options

Labels, the email mode and the screenshot mode come from the dashboard. Override them for one call with LerixFeedbackOptions:
To prefill the email for every flow, call Lerix.feedback.setUserEmail('user@example.com') once the user signs in.

Hide sensitive widgets

Wrap anything that must not appear in a screenshot in LerixConfidential. It is painted over before the image is created.

Your own UI

Send feedback from your own form with submit. Screenshots are PNG, JPEG or WebP bytes, up to 5 MB each.

Look and language

The flow follows your app’s theme (light or dark, primary colour). English and Arabic (right to left) are built in, and other languages fall back to English.

NPS survey

Call maybeShowNps at a calm moment, for example when the home screen appears. It returns true when the survey was shown.
The SDK only shows the survey when this install is due, using the rules you set in the dashboard (see When the survey is shown). With debugMode: true, the console says why a survey was skipped.

Analytics

  • $first_open, $session_start / $session_end, $app_update and $screen_view are recorded automatically.
  • Screen names come from the route’s name: GoRoute.name, or the name in RouteSettings / MaterialPage. Unnamed routes, dialogs and bottom sheets are skipped. LerixNavigatorObserver(includePopups: true) also reports named popups, and nameExtractor lets you name routes yourself.
  • Lerix.track never throws and can be called before Lerix.init. Invalid names and properties are dropped and logged in debug mode.
  • Events are stored on the device and sent in batches.
Call Lerix.setUser after sign-in. Analytics then counts the person across devices, and you can reply to their feedback by push.
The last 50 breadcrumbs are attached to every feedback report. Screen views are added automatically. Add your own: