EscapeSequence.unchecked constructor
- @mustBeConst String finalBytes,
- {@mustBeConst String prefix,
- @mustBeConst List<
int> parameters, - @mustBeConst List<
int> defaults}
Creates a new escape sequence without copying or validating the inputs.
This constructor is unsafe and should only be used when the inputs are
known to be correct and are all constant values. For example, when
creating an enum
that produces escape sequences:
enum ShakeTheScreen {
once(EscapeSequence.unchecked('H', [1], [1])),
twice(EscapeSequence.unchecked('H', [2])),
const ShakeTheScreen(this.sequence);
final EscapeSequence sequence;
}
Implementation
@literal
const factory EscapeSequence.unchecked(
@mustBeConst String finalBytes, {
@mustBeConst String prefix,
@mustBeConst List<int> parameters,
@mustBeConst List<int> defaults,
}) = _EscapeSequence.noCopy;