simple bluetooth curtain not working

I have been trying to control my curtains through bluetooth but this has been stopping me. Please tell me how to fix it

#include <Servo.h>
Servo myservo;
int state = 0;
int flag = 0;
/************************************************************/
void setup(){
  Serial.begin(9600);
  myservo.attach(9);
  pinMode(myservo, OUTPUT);
}
/************************************************************/
void loop() {
  if(Serial.available() > 0){
 state = Serial.read();
 flag=0;
 }
 if (state == '0') {
  digitalWrite.myservo(90);
  if(flag == 0){
  Serial.println("Curtains open");
  flag = 1;
  }
  else if (state == 1);
  digitalWrite.myservo(-90)
  if(flag == 0){
  Serial.println("Curtains closed");
  flag = 1;
  }
    
  }
}

And I get this:
exit status 1
cannot convert ‘Servo’ to ‘uint8_t {aka unsigned char}’ for argument ‘1’ to ‘void pinMode(uint8_t, uint8_t)’

Any help would be appreciated

  else if (state == 1);      // <---- REMOVE SEMI-COLON
  digitalWrite.myservo(-90)