Answer the question
In order to leave comments, you need to log in
How to fix type mismatch in dart?
An error like this is thrown
A value of type 'Object?' can't be assigned to a variable of type 'Object'.
Answer the question
In order to leave comments, you need to log in
// nullable может быть String или null
final String? nullable = "value";
// Если в nullable будет null - присвоит
// переменной nonNullable1 значение "default"
final String nonNullable1 = nullable ?? "default";
// Вызовет ошибку времени выполнения,
// если в nullable будет null
final String nonNullable2 = nullable!;
do you have null safety, Object? implies the possibility of null, Object - no
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question