replaceComponentItems function Null safety

void replaceComponentItems(
  1. String name,
  2. dynamic itemsString,
  3. [int index = 0,
  4. int offset = 0]
)

Same as setComponentItems but will set items starting from offset item

Implementation

void replaceComponentItems(String name, dynamic itemsString,
    [int index = 0, int offset = 0]) {
  List<Map<String, dynamic>> items = parseItems(itemsString);
  var elems = getElementsByName(name, index + 1);
  if (index < elems.length) {
    elems[index].widget?.setState(() {
      elems[index]
          .widget
          ?.items
          ?.replaceRange(offset, offset + items.length, items);
    });
  }
}