create method Null safety

Future<Response> create(
  1. dynamic table,
  2. {required Map<String, dynamic>? data}
)

Implementation

Future<Response> create(table, {required Map<String, dynamic>? data}) async {
  var db;

  if (_database == 'postgre') {
    var connection = PostgreSQLConnection(_host, _port, _db,
        username: _username, password: _password);
    await connection.open();
    db = await Postgre().create(connection, table, data: data);
  } else if (_database == 'mysql') {
    final connection = await MySQLConnection.createConnection(
      host: _host,
      port: _port,
      userName: _username,
      password: _password,
      databaseName: _db, // optional
    );

    await connection.connect();
    db = await MySql().create(connection, table, data: data);
  } else {}

  return db;
}