VerseLabel class final

The verse label of one text entry in a Bible translation.

A source may store combined verses under a label such as 3-4, or divide a verse into entries such as 5a and 5b. This model preserves that exact source while exposing normalized verse numbers and subdivision letters. It describes one source entry; an ordinary VerseRangeRef describes only the range and does not imply that its verses share a text entry.

Labels contain a verse number, optionally followed by one letter a-z, and an optional ascending endpoint in the same chapter. Uppercase letters and the Unicode syntax supported by ReferenceInputNormalizer are accepted. Numbers use the same broad sanity limits as VerseRef.

final label = VerseLabel.parse('3–4');
print(label.source); // 3–4
print(label.displayString); // 3-4
final reference = label.toReference(book: BibleBookEnum.john, chapter: 1);

Constructors

VerseLabel.fromJson(Map<String, Object?> json)
Restores a source label produced by toJson.
factory
VerseLabel.parse(String label)
Parses one source label, retaining its exact original spelling.
factory

Properties

displayString → String
The label with ASCII numbers, lowercase subdivisions, and a hyphen.
no setter
endSubdivision → String?
The lowercase ending subdivision letter, or null for a whole verse.
final
endVerse → int?
The ending verse number for a combined entry, or null for one verse.
final
hashCode → int
The hash code for this object.
no setteroverride
isCombined → bool
Whether this source entry combines a range of verses or subdivisions.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → String
The exact source label, including whitespace, case, digits, and dashes.
final
startSubdivision → String?
The lowercase starting subdivision letter, or null for a whole verse.
final
startVerse → int
The verse number at the start of this entry (1-based).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Serializes the exact source label without expanding a combined entry.
toReference({required BibleBookEnum book, required int chapter}) → Reference
Creates the location covered by this entry in book and chapter.
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

parseResult(String label) → ParseResult<VerseLabel>
Parses label into an explicit success or failure value.
tryParse(String label) → VerseLabel?
Parses label, returning null instead of throwing for invalid input.