findAndUpdateControlById method

Control? findAndUpdateControlById(
  1. String id, {
  2. bool update = false,
  3. Control? controlNew,
})

Implementation

Control? findAndUpdateControlById(String id,
    {bool update = false, Control? controlNew}) {
  Control? controlFind;

  for (var pages in lsPages) {
    for (var row in pages.row) {
      for (var control in row) {
        if (control.id == id) {
          controlFind = control;
          if (update) control = controlNew!;

          break;
        }
      }
      if (controlFind != null) break;
    }
    if (controlFind != null) break;
  }
  return controlFind;
}