Supplier<T> typedef

Supplier<T> = T Function()

A function that supplies a value of type T, typically lazily or on-demand.

Useful for factories or deferred value generation.

{@tool snippet}

final Supplier<DateTime> now = () => DateTime.now();
print(now());

{@end-tool}

Implementation

typedef Supplier<T> = T Function();