oncecall 0.0.2 copy "oncecall: ^0.0.2" to clipboard
oncecall: ^0.0.2 copied to clipboard

Oncecall is a memoization tool for use in the build method of Widgets.

Oncecall #

Oncecall is a memoization tool for use in the build method of Widgets.

Installation #

Run the following command:

dart pub add oncecall

Or add to your pubspec.yaml file:

dependencies:
  oncecall: latest

Usage #

class MyWidget extends StatelessWidget {
    const MyWidget({super.key});

    Widget build(BuildContext context) {
        final value = oncecall(context, () {
            // This function will only be executed once, even if the widget rebuilds
            return expensiveComputation();
        });

        return OtherWidget(value);
    }
}
1
likes
150
points
39
downloads

Publisher

verified publisherodroe.dev

Weekly Downloads

Oncecall is a memoization tool for use in the build method of Widgets.

Homepage
Repository (GitHub)
View/report issues

Topics

#once #call #memo

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

_octr, flutter

More

Packages that depend on oncecall