ConnectionValidationResult class
Represents the result of a connection validation check.
Connection validation occurs when:
- Starting to drag a connection from a port
- Attempting to complete a connection to a target port
The result indicates whether the operation should be allowed and optionally provides a reason and whether to show a user-facing message.
Usage Example
// Allow a connection
return ConnectionValidationResult.allow();
// Deny with a reason
return ConnectionValidationResult.deny(
reason: 'Cannot connect input to input',
showMessage: true,
);
// Custom result
return ConnectionValidationResult(
allowed: isValid,
reason: validationMessage,
showMessage: true,
);
Constructors
- ConnectionValidationResult({bool allowed = true, String? reason, bool showMessage = false})
-
Creates a connection validation result.
const
- ConnectionValidationResult.allow()
-
Creates a result that allows the connection.
const
- ConnectionValidationResult.deny({String? reason, bool showMessage = false})
-
Creates a result that denies the connection.
const
Properties
- allowed → bool
-
Whether the connection should be allowed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- reason → String?
-
Optional reason for denying the connection.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showMessage → bool
-
Whether to show a visual message to the user when the connection is denied.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited