create property

T Function(BuildContext context)? create
final

Optional function to create the resource lazily (on first access).

When provided, the provider manages the resource's lifecycle:

  • Calls onMount after creation if the resource implements JoltState
  • Calls onUnmount and disposes the resource when unmounted or replaced

The function receives the build context and should return the resource instance. Cannot be used together with value.

Implementation

final T Function(BuildContext context)? create;