zone_local 0.1.2
zone_local: ^0.1.2 copied to clipboard

discontinued

A simple package for defining zone-scoped values. Typically used for configuration objects.

Pub Package Github Actions CI

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 #

In pubspec.yaml:

dependencies:
  zone_local: ^0.1.2

In main.dart:

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
0
pub points
1%
popularity

Publisher

Unknown

A simple package for defining zone-scoped values. Typically used for configuration objects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

LICENSE

More

Packages that depend on zone_local