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

Watch Flutter widget tests render live in your editor. Companion package for the Live Test View VS Code extension.

example/lib/main.dart

import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) => const MaterialApp(
        debugShowCheckedModeBanner: false,
        home: CounterPage(),
      );
}

class CounterPage extends StatefulWidget {
  const CounterPage({super.key});

  @override
  State<CounterPage> createState() => _CounterPageState();
}

class _CounterPageState extends State<CounterPage> {
  int _count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Live Test View example')),
      body: Center(
        child: AnimatedOpacity(
          opacity: _count.isEven ? 1 : 0.3,
          duration: const Duration(milliseconds: 400),
          child: Text('$_count', style: const TextStyle(fontSize: 64)),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => setState(() => _count++),
        child: const Icon(Icons.add),
      ),
    );
  }
}
0
likes
150
points
115
downloads

Documentation

API reference

Publisher

verified publisheranirudhsingh.in

Weekly Downloads

Watch Flutter widget tests render live in your editor. Companion package for the Live Test View VS Code extension.

Repository

License

MIT (license)

Dependencies

flutter, flutter_test

More

Packages that depend on live_test_view