how i fix these problem and make x and y to can sum it ,because the vs code tell me the x and y does not Undefined name 'y' and Undefined name 'x'
import 'dart:io';
void main() {
print('enter your first number ');
var s = stdin.readLineSync();
//for null safety
if (s != null) {
int x = int.parse(s);
}
print('enter your second number');
var a = stdin.readLineSync();
if (a != null) {
int y = int.parse(a);
}
print('the sum is');
//here can not see the x and y varibale how i can put it
int res = x + y;
print(res);
}