Ezi Comments

Ezi Comments for Flutter

Add Ezi Comments to a Flutter app so reviewers can comment on its screens, on iOS and Android. Read the overview first for how it works and what you need in the dashboard.

Requirements

Install

The SDK is the Dart package ezi_comments. It is not on pub.dev yet; email damianosdev@gmail.com for the package and add it to pubspec.yaml from the folder you receive:

dependencies:
  ezi_comments:
    path: path/to/ezi_comments

Then run flutter pub get.

Set up

Wrap your app with EziReview in MaterialApp.builder and add EziNavigatorObserver. Turn review on only in debug or internal builds:

import 'package:ezi_comments/ezi_comments.dart';
import 'package:flutter/foundation.dart';

// On in debug builds, and in any build made with --dart-define=EZI_REVIEW=true.
const reviewEnabled = bool.fromEnvironment('EZI_REVIEW', defaultValue: kDebugMode);

MaterialApp(
  navigatorObservers: [EziNavigatorObserver()],
  builder: (context, child) => EziReview(
    config: EziConfig(
      projectKey: 'pk_your-project-key',
      endpoint: 'https://comments.example.com',
      app: EziAppInfo(appId: 'com.example.shop', appVersion: '2.4.0', build: '412'),
      enabled: reviewEnabled,
      launcher: true,     // floating button
      shakeToOpen: true,  // shake to open
    ),
    child: child!,
  ),
);

Store builds leave review off; build an internal version with it on, for example flutter build ipa --dart-define=EZI_REVIEW=true.

EziConfig and EziAppInfo throw an EziConfigurationError if a value is not valid; the message says which rule failed.

Open review mode

Pick one or more ways for reviewers to open it:

EziComments.show();     // capture the current screen and open review mode
EziComments.hide();     // close it
EziComments.signOut();  // sign the reviewer out

Name your screens

Comments are grouped by screen. The SDK picks the name in this order:

  1. the nearest visible EziScreen, or a name set with EziComments.setScreen('checkout');
  2. the screenId callback of EziReview;
  3. the last named route seen by EziNavigatorObserver;
  4. unknown.
EziScreen(id: 'checkout', child: CheckoutPage())

With GoRouter, add the observer to the router (GoRouter(observers: [EziNavigatorObserver()])), or return the route pattern from the callback:

EziReview(
  config: config,
  screenId: () => router.state.fullPath, // such as /orders/:id
  child: child!,
);

Names are 1 to 200 characters.

To tell developers which element a comment is about, wrap important widgets in EziViewHint. A pin inside it records its id:

EziViewHint(id: 'checkout.pay', child: PayButton())

Protect sensitive content

Wrap widgets that must not appear in screenshots in EziRedact. Their area is filled before the image is encoded:

EziRedact(child: Text(balance))

You can also mask a widget by its key with EziComments.redact(key). To skip screenshots on whole screens, add shouldCapture to EziConfig; reviewers can still comment there, and the comment posts without a screenshot:

shouldCapture: (screenId) => screenId != 'payment',

On Android, windows with FLAG_SECURE are never captured. Dialogs and bottom sheets are included in the screenshot; the SDK's own button and review screens are not. Platform views such as maps, web views and video appear blank.

Android backup

The reviewer's sign-in is kept with flutter_secure_storage. On Android, your app's automatic backup can copy its files, so exclude the shared preferences files FlutterSecureStorage.xml and FlutterSecureKeyStorage.xml from backup (with android:fullBackupContent, and android:dataExtractionRules for Android 12 and later), or set android:allowBackup="false". Then a restored device never carries a reviewer's sign-in.

Check that it works

  1. Add your app ids under Allowed apps and turn on Screenshots on the project's General page.
  2. Run a debug build (flutter run) and open review mode.
  3. Turn on Comment, tap anywhere on the screen, type a comment and tap Post.
  4. Sign in with your email and the 6-digit code.
  5. Open the project's Threads in the dashboard: the comment is there with the screenshot and your device details.

Troubleshooting

Other messages reviewers may see are explained in the overview.