create method Null safety

Future<void> create(
  1. DatabaseSchemaEntity entity

Creates the given entity, which can be a table, a view, a trigger, an index or an OnCreateQuery.


Future<void> create(DatabaseSchemaEntity entity) async {
  if (entity is TableInfo) {
    await createTable(entity);
  } else if (entity is Trigger) {
    await createTrigger(entity);
  } else if (entity is Index) {
    await createIndex(entity);
  } else if (entity is OnCreateQuery) {
    await _issueCustomQuery(entity.sql, const []);
  } else if (entity is ViewInfo) {
    await createView(entity);
  } else {
    throw ArgumentError('Unknown entity type: $entity');