layout_tester 0.1.0 copy "layout_tester: ^0.1.0" to clipboard
layout_tester: ^0.1.0 copied to clipboard

This helper package provides an easy interface for layout and widget composition testing.

example/lib/main.dart

import 'package:flutter/material.dart';

//============================================================
// NOTE:
// Relevant test example is located in 'test/widget_test.dart'
// file of this example project.
//============================================================

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() => setState(() => _counter++);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Text('$_counter', style: Theme.of(context).textTheme.headline4),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
0
likes
150
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

This helper package provides an easy interface for layout and widget composition testing.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

equatable, flutter, flutter_test

More

Packages that depend on layout_tester