replaceView method

void replaceView(
  1. int index,
  2. DashboardView newView, {
  3. bool ignoreErrors = false,
})

Replaces the view at the given index with the new view.

Implementation

void replaceView(int index, DashboardView newView, {bool ignoreErrors = false}) {
  if (views.contains(newView) && newView.name != Routes.blank) {
    if (!ignoreErrors) {
      models.home.setMessage(
        severity: Severity.error,
        text: "That view is already on-screen",
      );
    }
    return;
  }
  views[index] = newView;
  notifyListeners();
}