flutter_probe_agent 0.9.4
flutter_probe_agent: ^0.9.4 copied to clipboard
On-device E2E test agent for FlutterProbe. Embeds in your Flutter app and executes test commands via direct widget-tree access with sub-50ms latency.
import 'package:flutter/material.dart';
import 'package:flutter_probe_agent/flutter_probe_agent.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Only start the agent when built with --dart-define=PROBE_AGENT=true
const probeEnabled =
bool.fromEnvironment('PROBE_AGENT', defaultValue: false);
if (probeEnabled) {
await ProbeAgent.start();
}
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('FlutterProbe Example')),
body: const Center(child: Text('Hello, FlutterProbe!')),
),
);
}
}