void updateLine(int index, Line line) { if (_sealed) { throw StateError( 'Element of type ${line.runtimeType} at $index cannot be updated when $runtimeType is sealed'); } _lines[index] = line; }