Skip to content

Flutter bug reports

With bug reporting enabled, your users and beta testers can report a bug from inside your Flutter app on iOS and Android. A short form opens, they describe the issue and send it, and the report arrives in the Appelium Dashboard with a screenshot, a recording of the screen, the console logs and network logs that led up to it, and the device and app details. In-app bug reporting for iOS and Android walks through the flow from shake to fix, in beta testing and in production.

Enable bug reporting

AppeliumFeedback.start(
  apiKeys: apiKeys,
  bugReporting: const BugReportingConfiguration.enabled(),
);

With the defaults, shaking the device opens the bug report form, and the report includes a screenshot and a screen recording with touch indicators. Each option can be changed:

AppeliumFeedback.start(
  apiKeys: apiKeys,
  bugReporting: BugReportingConfiguration.enabled(
    screenshotsEnabled: true,
    screenRecording: const ScreenRecordingConfiguration.enabled(
      renderTouchEvents: false,
    ),
    invocationEvents: const {InvocationEvent.shake, InvocationEvent.screenshot},
    delegate: DiagnosticsAttachmentDelegate(),
  ),
);
Option Default Description
screenshotsEnabled true Attach a screenshot of the screen at the moment the form opens.
screenRecording ScreenRecordingConfiguration.enabled() Attach a recording of up to the last 3 minutes of the app's screen. renderTouchEvents, true by default, draws the user's touches as circles. Use ScreenRecordingConfiguration.disabled() to turn recording off.
invocationEvents {InvocationEvent.shake} Which user actions open the form. See Invocation events.
delegate null A BugReportingDelegate that adds your own file to each report.

Invocation events

  • InvocationEvent.shake: the user shakes the device.
  • InvocationEvent.screenshot: the user takes a screenshot with the device buttons. On Android, from Android 14, with the permission in your app's manifest.
  • An empty set, {}: no gesture opens the form. Use this when the report is opened only from your own UI.

Open the form from your app

Open the form from your own UI, for example from a "Report a problem" button in the settings screen:

FilledButton(
  onPressed: () => AppeliumFeedback.invoke(reporterEmail: currentUser?.email),
  child: const Text('Report a problem'),
)
  • reporterEmail prefills the email field. Leave it out to use the email the user entered in their previous report, if any.
  • The call does nothing if bug reporting is not enabled or the form is already open.

To send a report without showing the form at all, see Silent invocation.

Reporter email field

By default, the reporter must enter a valid email address before sending a report. Change it before the form is shown, for example right after start:

AppeliumFeedback.reporterEmailFieldMode = EmailFieldMode.optional;
Mode Behaviour
EmailFieldMode.required (default) The field is shown and a valid email address is needed to send.
EmailFieldMode.optional The field is shown and can be left empty. An entered address must be valid.
EmailFieldMode.hidden The field is not shown. A report carries only an email that you pass to invoke(reporterEmail:).

The form is prefilled with the email you pass to invoke, or else with the one of the previous report. Surrounding spaces are ignored.

Screen names

Bug reports, crash reports and the activity log name the visible screen. Without your help, every Flutter screen has the same name, FlutterViewController on iOS and your activity's class, such as MainActivity, on Android. Add AppeliumNavigatorObserver to your navigator to name each screen after its route:

MaterialApp(
  navigatorObservers: [AppeliumNavigatorObserver()],
  routes: {
    '/': (context) => const HomePage(),
    '/checkout': (context) => const CheckoutPage(),
  },
)
  • A screen is named after its route's settings.name, such as /checkout. Give your routes names: an unnamed route is named after its type, such as MaterialPageRoute<void>, which says little, and which obfuscated builds rename.
  • Dialogs, bottom sheets and menus without a name are not screens: the screen below them keeps its name.
  • With routing packages, add the observer where they take observers, for example GoRouter(observers: [AppeliumNavigatorObserver()]). Use one observer per navigator.

To name screens yourself, for example the tabs of a screen, call setScreenName when the screen is shown:

AppeliumFeedback.setScreenName('Checkout');

Each new name is logged as the next screen. Pass null to use the native name again.

What the reporter sees

The form is the native form of each platform, in the device's light or dark appearance: a sheet on iOS and a full-screen dialog on Android. It contains:

  • an email field, depending on the reporter email field mode;
  • a description field;
  • the screenshot, which the reporter can open and mark up to highlight the problem;
  • the screen recording.

The reporter can remove the screenshot or the recording before sending.

What a bug report contains

  • The reporter's description and, if collected, email address.
  • The screenshot and screen recording, if enabled and not removed by the reporter.
  • The activity log from before the report: console logs, network logs and app events. See logs retention.
  • The name of the screen that was visible. See Screen names.
  • Device and app details such as the device model, OS version, app version and build, and locale.
  • The user identifier and backend environment, if set.
  • Your attachment, if a delegate is configured.

Privacy

The screenshot and the screen recording show everything that was on the app's screen, including any text the user typed. They stay on the device and are uploaded only when the reporter sends a report. If your app shows sensitive content, consider disabling the recording with ScreenRecordingConfiguration.disabled(), or offering bug reporting only to beta testers or internal builds.

Troubleshooting

  • Shaking does nothing: check that bugReporting is enabled and invocationEvents contains InvocationEvent.shake. In the iOS Simulator, use Device › Shake; in the Android emulator, Extended controls › Virtual sensors › Move.
  • The form never opens from invoke: check that bug reporting is enabled in start and that invoke is called after start.
  • Every screen has the same name: add AppeliumNavigatorObserver to your navigator, and give your routes names.
  • The Send button stays disabled: the email field is required and the address is not valid. Use EmailFieldMode.optional or EmailFieldMode.hidden if your users should not need one.