inspector 2.1.0 copy "inspector: ^2.1.0" to clipboard
inspector: ^2.1.0 copied to clipboard

A Flutter package for inspecting widgets. Useful for quick debugging or QA testing.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:inspector/inspector.dart';

void main() {
  runApp(
    MaterialApp(
      home: ExampleApp(),
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark(),
      themeMode: ThemeMode.system,
      builder: (context, child) => Inspector(
        child: child!,
        isEnabled: true,
      ),
    ),
  );
}

class ExampleApp extends StatefulWidget {
  const ExampleApp({Key? key}) : super(key: key);

  @override
  _ExampleAppState createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  Widget _buildListItem(int index) {
    return ListTile(
      title: Text('Item #$index'),
      subtitle: Text('A subtitle'),
      leading: Container(
        width: 32.0,
        height: 32.0,
        decoration: BoxDecoration(
          color: Theme.of(context).primaryColor,
          shape: BoxShape.circle,
        ),
        alignment: Alignment.center,
        child: Text(
          '$index',
          style: TextStyle(
            color: Colors.white,
            fontWeight: FontWeight.w600,
          ),
        ),
      ),
      trailing: IconButton(
        icon: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Example'),
      ),
      body: ListView.builder(
        itemCount: 100,
        itemBuilder: (context, i) => _buildListItem(i),
      ),
    );
  }
}
61
likes
130
pub points
87%
popularity

Publisher

verified publisherkekland.com

A Flutter package for inspecting widgets. Useful for quick debugging or QA testing.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on inspector