VerseRangeRef class

A reference to a range of Bible verses.

This class represents a contiguous range of verses from a start verse to an end verse. The range can span multiple chapters within the same book, or even cross book boundaries. Instances are immutable and thread-safe.

Example:

final range = VerseRangeRef.parse("John 3:16-17");
print(range.start.displayString); // "John 3:16"
print(range.end.displayString); // "John 3:17"
print(range.displayString); // "John 3:16-17"
Inheritance
Available extensions

Constructors

VerseRangeRef({required VerseRef start, required VerseRef end})
const
VerseRangeRef.checked({required VerseRef start, required VerseRef end})
Creates an ascending range.
factory

Properties

displayString → String
Returns a human-readable string representation of this reference.
no setteroverride
end → VerseRef
The last verse in the range (inclusive).
final
hashCode → int
The hash code for this object.
no setteroverride
osisIdentifier → String

Available on Reference, provided by the ReferenceMachineIdentifiers extension

Encodes this reference as an OSIS identifier.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → VerseRef
The first verse in the range (inclusive).
final
usfmIdentifier → String

Available on Reference, provided by the ReferenceMachineIdentifiers extension

Encodes this reference as a USFM machine-readable reference.
no setter

Methods

copyWith({VerseRef? start, VerseRef? end}) → VerseRangeRef
format({BibleLanguageEnum language = BibleLanguageEnum.english, ReferenceBookNameStyle bookNameStyle = ReferenceBookNameStyle.long, bool compactRanges = true}) → String

Available on Reference, provided by the LocalizedReferenceFormatting extension

Formats this reference with localized long or short book names.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Converts this reference to a stable JSON-compatible map.
override
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(Map<String, Object?> json) → VerseRangeRef
Restores a range reference produced by toJson.
override
parse(String ref, {BibleLanguageEnum? language}) → VerseRangeRef
Parses a string into a verse range reference.
override
parseResult(String ref, {BibleLanguageEnum? language}) → ParseResult<VerseRangeRef>
Parses ref into an explicit success or failure value.
override
tryParse(String ref, {BibleLanguageEnum? language}) → VerseRangeRef?
Parses ref, returning null instead of throwing for invalid input.
override