TemplateHookResult class

Structured outcome of executing a single TemplateHook.

Constructors

TemplateHookResult({required String hookId, required TemplateHookPhase phase, required TemplateHookStatus status, required Duration duration, List<TemplateHookDiagnostic> diagnostics = const [], List<TemplateHookAction> proposedActions = const [], String? errorMessage})
Creates a TemplateHookResult.
const
TemplateHookResult.failure({required String hookId, required TemplateHookPhase phase, required Duration duration, required String error, List<TemplateHookDiagnostic> diagnostics = const []})
Factory constructor for failed execution.
factory
TemplateHookResult.skipped({required String hookId, required TemplateHookPhase phase, String reason = 'Hook disabled or skipped'})
Factory constructor for skipped execution.
factory
TemplateHookResult.success({required String hookId, required TemplateHookPhase phase, required Duration duration, List<TemplateHookDiagnostic> diagnostics = const [], List<TemplateHookAction> proposedActions = const []})
Factory constructor for successful execution.
factory

Properties

diagnostics → List<TemplateHookDiagnostic>
List of diagnostic entries emitted during hook execution.
final
duration → Duration
Execution duration.
final
errorMessage → String?
Error details if the hook failed.
final
hashCode → int
The hash code for this object.
no setterinherited
hookId → String
Unique identifier of the hook.
final
isSuccessful → bool
Indicates if this result represents a success or warning status.
no setter
phase → TemplateHookPhase
Target lifecycle phase.
final
proposedActions → List<TemplateHookAction>
List of proposed declarative actions returned by the hook.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → TemplateHookStatus
Final execution status.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes result to JSON.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited