Flutter

Investigate Flutter behavior and rendering performance with session evidence and widget inspection on Android, iOS, and macOS.

Compare what your Flutter app rendered with user actions, app events, and frame timings. Ansight gives developers and agents session evidence and framework-aware tools to investigate the behavior behind a UI or performance issue.

ansight_flutter brings the native Ansight Android and Apple runtimes to Flutter and adds framework-aware lifecycle, navigation, error, frame-timing, network capture, purchase diagnostics, and widget-tree instrumentation. Version 1.6.0 adds Flutter macOS desktop support.

Use the current Flutter SDK package in development builds and validate the exact version before distributing it.

Open your app repository in a coding agent and send this prompt:

Copyable prompt:

Use https://www.ansight.ai/skills/flutter/ansight-install-flutter.md to install Ansight in this Flutter app. Keep it in a development build, verify a connected session, and show me the changes.

The setup guide has the manual steps.

Quick Start

Install the latest release from pub.dev:

flutter pub add ansight_flutter
import 'package:ansight_flutter/ansight.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  if (kDebugMode) {
    await Ansight.instance.initializeAndActivate(
      AnsightOptions.developer(
        clientName: 'My Flutter App',
        toolGuard: AnsightToolGuard.readOnly,
      ),
    );
    await AnsightFlutterInstrumentation.instance.install();
  }

  runApp(
    AnsightFlutterCaptureBoundary(
      controller: AnsightFlutterCaptureController(),
      child: const MyApp(),
    ),
  );
}

The capture boundary is required on macOS for automatic Flutter-rendered screenshots, timestamp-correlated Flutter visual trees, and pointer evidence. It follows the configured JPEG cadence and deduplicates unchanged frames.

Add AnsightNavigatorObserver() to MaterialApp.navigatorObservers to capture route changes and expose navigation state.

For the complete guarded startup, stable ValueKey example, and CLI verification flow, use Flutter Setup.

Use Flutter Packages for package and platform compatibility details.

What the Integration Adds

  • Native Android and Apple runtime connection, trends telemetry, logs, artifacts, and remote tool suites including Clipboard.
  • Native mobile screenshots and touches, plus Flutter-compositor screenshots, Flutter visual trees, Flutter-derived FPS, and pointer evidence inside AnsightFlutterCaptureBoundary on macOS.
  • AnsightHttpClient and manual sanitized network request recording.
  • Mobile simulator/emulator-only purchase observation and validation through Ansight.instance.purchases.
  • Flutter frame build, raster, total-time, and frame-count channels.
  • Automatic Flutter lifecycle and error capture.
  • Native crash recovery with Flutter error candidates and next-launch handoff.
  • flutter.* widget-tree, widget inspection, search, and navigation tools.
  • A Flutter source in the native ui.* visual-tree tools.

Use Flutter Security before putting the package or enrollment UI in any distributable build.

Native AppKit screenshots, AppKit visual-tree inspection and actions, AppKit touch capture outside the Flutter boundary, QR enrollment, and purchase diagnostics are not currently available on macOS.

See Network Capture, Clipboard Tools, and Purchase Diagnostics for the shared integration and privacy contracts.

Use Connectivity Capture to record OS connection state, transport changes, and supported quality estimates. See Native Offline Capture for disconnected recording and host transfer across mobile SDKs, implemented after SDK 1.8.0.

Use Flutter Motion Capture to forward shakes and accelerometer samples observed by the app on supported mobile targets.