golden_lens 0.2.0 copy "golden_lens: ^0.2.0" to clipboard
golden_lens: ^0.2.0 copied to clipboard

Agent-grade golden tests for Flutter: attribute visual diffs to the exact widget and source line, score perceptual parity, and emit agent-readable reports.

example/lib/main.dart

import 'package:flutter/material.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) => const MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Scaffold(body: Center(child: PriceCard())),
      );
}

/// A small card whose golden we test in `test/price_card_golden_test.dart`.
class PriceCard extends StatelessWidget {
  const PriceCard({super.key});

  @override
  Widget build(BuildContext context) {
    return Card(
      elevation: 4,
      child: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: const <Widget>[
            Text('Pro',
                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
            SizedBox(height: 8),
            Text(r'$12 / mo'),
          ],
        ),
      ),
    );
  }
}
1
likes
160
points
48
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Agent-grade golden tests for Flutter: attribute visual diffs to the exact widget and source line, score perceptual parity, and emit agent-readable reports.

Repository (GitHub)
View/report issues

Topics

#testing #golden #visual-regression #ai

License

MIT (license)

Dependencies

flutter, flutter_test

More

Packages that depend on golden_lens