excludeTables function

List<Table> excludeTables(
  1. List<Table> tables,
  2. Map<String, List<String>?>? excludeList
)

Implementation

List<Table> excludeTables(
  List<Table> tables,
  Map<String, List<String>?>? excludeList,
) {
  if (excludeList == null) //
    return tables;

  var excludedTables = excludeList //
      .entries
      .where((element) => element.value == null)
      .map((e) => e.key)
      .toList();

  var result = tables.where((x) => !excludedTables.any((element) => element == x.tableName)).toList();

  return result;
}