title: How to take integer input from user in dart
body: <p>i am new in dart and just want to know how to take integer input from user in dart with null safety. i found out a way to take number input from dart which is:</p>
  <pre><code>String? chossenNumber =  stdin. readLineSync();
     if(chossenNumber !=null)
     {
       int number = int.parse(chossenNumber);
     }
  </code></pre>
  <p>but i am unable to use number variable outside of the scope. Please tell me a way to solve this issue.</p>