Skip to main content

dependency_box_devtools 1.0.0 copy "dependency_box_devtools: ^1.0.0" to clipboard
dependency_box_devtools: ^1.0.0 copied to clipboard

Official Flutter DevTools extension for dependency_box to inspect registrations, scopes, and dependency graphs

dependency_box_devtools #

pub package Star on GitHub GitHub Sponsor License: MIT

Official Flutter DevTools extension for dependency_box providing interactive container inspection, scope hierarchy trees, dependency graph visualization, and health diagnostics.


Features #

  • Interactive Registrations Table: Search and filter by type name, qualifying key, lifetime strategy, owning scope, and heap allocation state.
  • Scope Hierarchy Tree: Inspect root and child scope nesting depths, direct registration counts, and disposal lifecycles.
  • Dependency Graph Viewer: Interactive pan-and-zoom visual cluster viewer mapping services to their owning scopes.
  • Diagnostics & Health Audits: Automatic detection of shadowed registrations, disposed scope access, and multi-registration strategies.
  • Zero Runtime Overhead: On-demand inspection model. Absolutely zero work or allocation is performed on hot resolution paths when DevTools is inactive.
  • Memory-Safe Weak References: DevTools holds weak references to containers, completely eliminating memory leaks.

Getting Started #

Installation #

Add dependency_box to your dependencies and dependency_box_devtools to your dev_dependencies:

dependencies:
  dependency_box: ^1.2.0

dev_dependencies:
  dependency_box_devtools: ^1.0.0

Or run:

flutter pub add dependency_box
flutter pub add --dev dependency_box_devtools

Import #

import 'package:dependency_box/dependency_box.dart';
import 'package:dependency_box_devtools/dependency_box_devtools.dart';

Usage #

1. Register Container for DevTools Inspection #

In your Flutter application's initialization code (typically in main.dart):

import 'package:flutter/material.dart';
import 'package:dependency_box/dependency_box.dart';
import 'package:dependency_box_devtools/dependency_box_devtools.dart';

void main() {
  final box = DependencyBox.main(name: 'AppRoot');

  // Register dependencies
  box.addSingleton<ApiClient>(ApiClient());
  box.addLazySingleton<AuthService>((c) => AuthService(c.get<ApiClient>()));

  // Register with DevTools (zero overhead in production)
  DependencyBoxDevTools.register(box);

  runApp(const MyApp());
}

2. Connect with Flutter DevTools #

  1. Run your Flutter application in debug or profile mode:
    flutter run
    
  2. Open Flutter DevTools (from VS Code, Android Studio, or via flutter run terminal URL).
  3. Select the dependency_box tab in DevTools.
  4. Explore registrations, inspect scopes, and view the dependency layout!

Supporting & Contributing #

If you find dependency_box_devtools helpful, here are several ways you can support the project:

🌟 Community Support #

  • Star the Repository: Star ahmedm-gh/dart-packages on GitHub to help others discover it.
  • Report Issues & Ideas: Found a bug or need an improvement? Open an issue on GitHub Issues.
  • Contribute: Pull requests for optimizations, documentation, or examples are always welcome.
  • Spread the Word: Recommend dependency_box in your Flutter/Dart teams, blogs, or communities.

☕ Sponsorship & Backing #

  • Sponsor on GitHub: If this package brings value to your commercial apps, consider supporting its maintenance via GitHub Sponsors.
  • Buy Me a Coffee: Support development with a one-time coffee or recurring donation via Buy Me a Coffee.

Author & Maintainer #

Created and maintained by AHMED M.

License #

This package is licensed under the MIT License.

1
likes
150
points
616
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Official Flutter DevTools extension for dependency_box to inspect registrations, scopes, and dependency graphs

Repository (GitHub)
View/report issues

Topics

#devtools #devtools-extension #dependency-injection #ioc #container

Funding

Consider supporting this project:

github.com
buymeacoffee.com

License

MIT (license)

Dependencies

dependency_box, devtools_extensions, flutter, vm_service

More

Packages that depend on dependency_box_devtools