zone_local 0.1.1 copy "zone_local: ^0.1.1" to clipboard
zone_local: ^0.1.1 copied to clipboard

discontinued
outdated

Type-safe zone-scoped variables.

Introduction #

What's a zone? See explanation of zones at dartlang.org.

If you are declaring a static variable, this package gives you:

  • Type-safe zone-scoped mutability
  • Helpful methods for forking zones

Getting Started #

dependencies:
  zone_local: ^0.1.1
import 'package:zone_local/zone_local.dart';

final ZoneLocal<String> greeting = new ZoneLocal<String>(defaultValue:"Hello!");

void main() {
  print(greeting.value);
  
  // Run a function in a forked zone that sees value "Hi!"
  greeting.forkZoneWithValue("Hi!").run(() {
    print(greeting.value);
  });
}
0
likes
25
pub points
5%
popularity

Publisher

unverified uploader

Type-safe zone-scoped variables.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

More

Packages that depend on zone_local