A library adding lazy evaluation to Dart. This package is based on Günter Zöchbauer's answer on the StackOverflow question How to do lazy evaluation in Dart?.
A simple usage example:
import 'package:lazy/lazy.dart';
class Foo {
final _value = LazyValue(() {
print('lazy');
return 10;
});
int get value => _value();
}
main() {
final foo = Foo();
print(foo.value);
// Print lazy, then 10
print(foo.value);
// Print only 10.
}
Please file feature requests and bugs at the issue tracker.