fix: move ValidationResult.invalid constructor before fields (sort_constructors_first)
This commit is contained in:
parent
6afd2658a0
commit
778ab5118e
|
|
@ -5,18 +5,18 @@ import 'package:uto_manager/domain/entities/unit_node.dart';
|
|||
|
||||
/// Result of a doctrinal validation check.
|
||||
class ValidationResult {
|
||||
/// Creates a [ValidationResult] with explicit [isValid] and optional [reason].
|
||||
const ValidationResult({required this.isValid, this.reason});
|
||||
|
||||
/// Creates a failing validation result with a [reason].
|
||||
ValidationResult.invalid(this.reason) : isValid = false;
|
||||
|
||||
/// Whether the operation is doctrinally valid.
|
||||
final bool isValid;
|
||||
|
||||
/// Human-readable reason if [isValid] is false.
|
||||
final String? reason;
|
||||
|
||||
// ignore: sort_constructors_first
|
||||
/// Creates a failing validation result with a [reason].
|
||||
ValidationResult.invalid(this.reason) : isValid = false;
|
||||
|
||||
/// A passing validation result.
|
||||
static const valid = ValidationResult(isValid: true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue