Repro Steps for Flutter

Learn more about the steps your user has taken until the bug or crash was reported on your Flutter app.

Repro Steps show you all of the interactions a user makes with your app up until a bug or crash is reported, grouped by app view. For each view that a user visits, all of the steps that they commit within those views are captured and displayed as a log, grouped by view.

2888

An example of Repro Steps in the Instabug dashboard.

Getting Started

To enable Instabug's user steps and privacy features for Flutter, you must wrap your root application widget with the InstabugWidget. This is a mandatory step for these features to function correctly.

import 'package:instabug_flutter/instabug_flutter.dart';  

void main() {  
  runApp(  
    InstabugWidget(  
      child: MyApp(),  
    ),  
  );  
}

Configuration

The InstabugWidget provides several options to configure its behavior at initialization.

InstabugWidget(  
  enablePrivateViews: true,  
  enableUserSteps: true,  
  automasking: const [  
    AutoMasking.labels,  
    AutoMasking.textInputs,  
    AutoMasking.media  
  ],  
  child: MyApp(),  
),
  • enablePrivateViews: A boolean that enables or disables the Private Views feature. It is enabled by default.
  • enableUserSteps: A boolean that enables or disables the User Steps feature (which is used in ReproSteps). It is enabled by default.
  • automasking: A list that enables Auto Masking for specific types of views. By default, no auto masking is applied.

Setting Up Repro Steps

To enable Repro Steps, you simply need to add InstabugNavigatorObserver to the navigatorObservers as shown below:

runApp(MaterialApp(
   navigatorObservers: [InstabugNavigatorObserver()],
 ));

Logged Data

Captured Events

UI Interactions

For the following gestures, only the gesture is logged and displayed:

  • Swipe
  • Scroll
  • Pinch
  • Tap
  • Force touch
  • Double tap
  • Enabling/disabling a switch
  • Changing the value of a slider
  • Editing a text field.

Lifecycle Events

Whenever one of the following lifecycle events occurs, it will be captured and shown on the timeline:

  • Application is moved to the background
  • Application is moved to the foreground
  • Application becomes active
  • Application becomes inactive
  • Memory warning

Extra Details

Depending on the event, you'll find further details displayed as part of the log statement.

  • Tap, double tap, and force touch: the SDK always tries to first capture the text rendered inside the UI that the user is interacting with, then we fall back to capturing the icon only with the buttons and navigation items, then, we fall back to the accessibility labels.
  • Switch: both the accessibility label as well as whether the user enabled or disabled the switch are logged.
  • Slider: both the accessibility label as well as the value that the user moves the slider to it are captured.
  • Text fields: first, the SDK tried to capture the placeholder, then we fall back to the accessibility label.

Examples

Here are some examples of how steps look like:

  • Tapped on the button "Send"
  • Double tapped on UI that contains "Instructions"
  • Started editing “Password“
  • Enabled the switch “Push Notifications“
  • Moved the slider “Text Size“ to 10%
  • App went to the background
  • App became active
  • Memory warning

User Privacy

Disclaimer

A disclaimer will be shown at the bottom of the report. It helps your users view all the screenshots taken for the Repro Steps before sending a report and can delete them as well.

Private Views

You can easily mark any specific widget that might contain sensitive information as private. Any private view will automatically appear with a black overlay covering it in any screenshot. This feature must be enabled via the enablePrivateViews flag in the InstabugWidget (enabled by default).

To make a widget private, wrap it with the InstabugPrivateView widget.

InstabugPrivateView(  
  child: TextFormField(  
    decoration: const InputDecoration(hintText: "Password"),  
    obscureText: true,  
  ),  
),

For widgets within a scrollable list, such as a ListView or CustomScrollView, use the InstabugSliverPrivateView to ensure privacy for sliver widgets.

InstabugSliverPrivateView(  
  child: SliverFillRemaining(  
    child: Text("This private sliver content will be masked"),  
  ),  
),

📘

Good to Know

  • Screen Recordings: Private Views are not masked in screen recordings. For Flutter apps on Android, you can use Android's FLAG_SECURE to prevent screen capture of sensitive views.
    • On iOS they are masked for both screenshots (in ReproSteps) & screen recordings.
  • Animated Views: Private Views will be masked in both static and animated states. However, very rapid animations may occasionally not be masked correctly.

Auto Masking

This feature automatically masks sensitive data when screenshots are captured, protecting your users' privacy by default. To enable Auto Masking, pass a list of AutoMasking types to the automasking parameter in the InstabugWidget.

Here is an example of masking text input fields and text labels:

void main() {
  runApp(
    InstabugWidget(
      automasking: const [
        AutoMasking.labels,
        AutoMasking.textInputs,
      ],
      child: MyApp(),
    ),
  );
}

Here are all the possible parameters you can pass in the list:

ParameterDescription
AutoMasking.textInputsMasks text input and text area fields
AutoMasking.labelsMasks text labels, including buttons and titles
AutoMasking.mediaMasks media previews like images

To disable Auto Masking, simply pass an empty list [] to the automasking parameter.

📘

Note

The InstabugPrivateView widget takes precedence over Auto-masking. If you need to ensure a specific view is always masked, wrapping it in InstabugPrivateView is the recommended approach.

Disabling and Enabling

Repro Steps is by default enabled with screenshots for both bug reporting and session replay and enabled without screenshots for crash reporting.

Instabug.setReproStepsConfig(
  bug: ReproStepsMode.enabled,
  crash: ReproStepsMode.enabledWithNoScreenshots,
  sessionReplay: ReproStepsMode.enabled,
);

To configure Repro Steps, use the Instabug.setReproStepsConfig() method. You can configure the desired mode for bug reports, crash reports, and session replay separately using the bug, crash, and sessionReplay parameters or configure all of them using the all parameter, which overrides bug, crash, and sessionReplay.

Instabug.setReproStepsConfig(
  all: ReproStepsMode.enabled,
); 

Possible Arguments:

//Enable Repro Steps with screenshots
ReproStepsMode.enabled
//Enable Repro Steps without screenshots
ReproStepsMode.enabledWithNoScreenshots
//Disable Repro Steps
ReproStepsMode.disabled

Examples

APIMeaning
Instabug.setReproStepsConfig(all: ReproStepsMode.enabled)

or

Instabug.setReproStepsConfig(bug: ReproStepsMode.enabled, crash: ReproStepsMode.enabled, sessionReplay: ReproStepsMode.enabled);
Enabled with screenshots for Bug Reporting, Crash Reporting, and Session Replay.



When the all value is present, it overrides all the the other arguments.
Instabug.setReproStepsConfig(crash: ReproStepsMode.enabledWithNoScreenshots)Enabled with no screenshots for Crash Reporting. (Bug Reporting and Session Replay still retain the default value enabled)
Instabug.setReproStepsConfig(bug: ReproStepsMode.enabled)Enabled with screenshot for Bug Reporting. (Crash Reporting and Session Replay still retain the default values of enabled without screenshots and enabled respectively)
Instabug.setReproStepsConfig(all: ReproStepsMode.disabled)

or

Instabug.setReproStepsConfig(bug: ReproStepsMode.disabled, crash: ReproStepsMode.disabled, sessionReplay: ReproStepsMode.disabled)
Completely disabled for Bug Reporting, Crash Reporting, and Session Replay.

📘

Screenshots are always disabled with Crash Reporting.

For Crash Reporting, the screenshots are always disabled as the data is silently collected without any interaction from the user. This decision is part of our ongoing commitment to end-users' privacy.