LrcStream constructor

LrcStream({
  1. LrcLine? previous,
  2. required LrcLine current,
  3. LrcLine? next,
  4. Duration? duration,
  5. required int position,
  6. required int length,
})

The main constructor for a LrcStream

Implementation

LrcStream(
    {this.previous,
    required this.current,
    this.next,
    this.duration,
    required this.position,
    required this.length})
    //position should be greater than or equal to 0
    : assert(position >= 0),
      //the length should be greater than or equal to the position
      assert(length >= position),
      //previous is null only if position is 0
      assert((previous == null) ? position == 0 : true),
      //next is null only if position is the last
      assert((next == null) ? position == length : true);