getEnabledRows function

List<NameValueModel>? getEnabledRows(
  1. List<NameValueModel>? rows,
  2. List<bool>? isRowEnabledList
)

Implementation

List<NameValueModel>? getEnabledRows(
  List<NameValueModel>? rows,
  List<bool>? isRowEnabledList,
) {
  if (rows == null || isRowEnabledList == null) {
    return rows;
  }
  List<NameValueModel> finalRows = rows
      .where((element) => isRowEnabledList[rows.indexOf(element)])
      .toList();
  return finalRows == [] ? null : finalRows;
}