connectDB method

void connectDB()

Implementation

void connectDB() async {
   var settings = new ConnectionSettings(
    host: host!,
    port: port!,
    user: username!,
    password: password,
    db: databaseName
  );
  try{
    var conn = await MySqlConnection.connect(settings);
    print('[Connected to MySql server]');
    _con=conn;
  } on MySqlException catch(e){
    throw e;
  }
}