oncecall 0.0.0 copy "oncecall: ^0.0.0" to clipboard
oncecall: ^0.0.0 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
0
pub points
0%
popularity

Publisher

verified publisherodroe.dev

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

Homepage
Repository (GitHub)
View/report issues

Topics

#once #call #memo

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

_octr, flutter

More

Packages that depend on oncecall