I'm just starting out with dart and have been trying to do some user input and output, but I'm getting this error:
A value of type 'String?' can't be assigned to a variable of type 'String'. Try changing the type of the variable, or casting the right-hand type to 'String'.
Here the little code:
import 'dart:io';
main(){
//Esto es para cuando el usuario quiera ingresar por teclado
stdout.writeln('¿Como te llamas: ?');
String name = stdin.readLineSync(); //linea del error
print('My name is $name');
}