TextSelection.collapsed constructor Null safety

const TextSelection.collapsed(
  1. {required int offset,
  2. TextAffinity affinity}

Creates a collapsed selection at the given offset.

A collapsed selection starts and ends at the same offset, which means it contains zero characters but instead serves as an insertion point in the text.

The offset argument must not be null.


const TextSelection.collapsed({
  required int offset,
  this.affinity = TextAffinity.downstream,
}) : baseOffset = offset,
     extentOffset = offset,
     isDirectional = false,