Reference class sealed

Base class for all Bible reference types.

This sealed class provides a unified interface for working with either single verses or verse ranges. Use Reference.parse for flexible parsing that automatically determines the appropriate subtype.

Example:

final ref = Reference.parse("John 3:16");
if (ref is VerseRef) {
  print("Single verse: ${ref.displayString}");
} else if (ref is VerseRangeRef) {
  print("Range: ${ref.displayString}");
}
Implementers
Available extensions

Properties

displayString → String
Returns a human-readable string representation of this reference.
no setter
hashCode → int
The hash code for this object.
no setterinherited
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
usfmIdentifier → String

Available on Reference, provided by the ReferenceMachineIdentifiers extension

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

Methods

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.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

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