What does "?" mean in the variable statement in dart?
E.g.
String? name;
Answer
Nullable type
Explanation
"?" mean the value of this variable can be "null".
In Dart, by default, the variable can not be "null".
When you specify a type for a variable, parameter, or another relevant component, you can control whether the type allows null. To enable nullability, you add a ? to the end of the type declaration.
String? name //Nullable type. Can be `null` or string.
String name // Non-nullable type. Cannot be `null` but can be string.
You must initialize variables before using them. Nullable variables default to null, so they are initialized by default. Dart doesn't set initial values to non-nullable types.