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

A lightweight and intuitive dependency injection library for Dart applications leveraging Zones.

Scoped #

A simple dependency injection library built on Zones.

codecov


Quick Start #

import 'package:scoped_zone/scoped.dart';

final value = create(() => 42);

void main() {
  runScoped(scopeA, values: {value});
}

void scopeA() {
  print(read(value)); // 42
  runScoped(scopeB, values: {value.overrideWith(() => 0)});
}

void scopeB() {
  print(read(value)); // 0
}
3
likes
160
points
62
downloads

Publisher

verified publishergoflutter.in

Weekly Downloads

A lightweight and intuitive dependency injection library for Dart applications leveraging Zones.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on scoped_zone