columnForName method Null safety

SchemaColumn? columnForName(
  1. String name
)

Returns a SchemaColumn with name.

Case-insensitively compares names of columns with name. Returns null if no column exists with name.

Implementation

SchemaColumn? columnForName(String name) {
  final lowercaseName = name.toLowerCase();
  return columns
      .firstWhereOrNull((col) => col.name.toLowerCase() == lowercaseName);
}