designedWithLifecycle abstract method
Configures lifecycle design for the pod.
Parameters:
lazy
: Whether initialization should be deferred until first access.initMethods
: List of method names to call during initialization.destroyMethods
: List of method names to call during destruction.enforceInitMethod
: Enforces that init methods exist on the class.enforceDestroyMethod
: Enforces that destroy methods exist on the class.
Example
spec.designedWithLifecycle(
lazy: true,
initMethods: ['init'],
destroyMethods: ['dispose'],
enforceInitMethod: true,
);
Implementation
Spec<T> designedWithLifecycle({
bool lazy = false,
List<String> initMethods = const [],
List<String> destroyMethods = const [],
bool enforceInitMethod = false,
bool enforceDestroyMethod = false,
});