tableForName method Null safety

SchemaTable? tableForName(
  1. String name
)

Returns a SchemaTable for name.

name is case-insensitively compared to every SchemaTable.name in tables. If no table with this name exists, null is returned.

Note: tables are typically prefixed with an underscore when using Conduit naming conventions for ManagedObject.

Implementation

SchemaTable? tableForName(String name) {
  final lowercaseName = name.toLowerCase();

  return tables
      .firstWhereOrNull((t) => t.name!.toLowerCase() == lowercaseName);
}