setNumViews method

void setNumViews(
  1. int? value
)

Adds or subtracts a number of views to/from the UI

Implementation

void setNumViews(int? value) {
  if (value == null || value > 8 || value < 1) return;
  final currentNum = views.length;
  if (value < currentNum) {
    views = views.sublist(0, value);
  } else {
    for (var i = currentNum; i < value; i++) {
      views.add(DashboardView.blank);
    }
  }
  notifyListeners();
}