Skip to content
forked from fluidic/lazy

A library adding lazy evaluation to Dart.

License

Notifications You must be signed in to change notification settings

mateusfccp/lazy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy

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?.

Usage

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.
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

A library adding lazy evaluation to Dart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%