python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Why doesn't type casting List<Widget?> as List<Widget> work if we remove all nulls with .removeNulls() before?
Option A: not working
var a = <Widget?>[Container(), null];
a.removeNulls();
print(a.length == 1 && a[0] != null) // true
var b = a as List<Widget>; // _CastError (type 'List<W...
Thorge
Votes: 0
Answers: 2
A value of type 'Object?' can't be assigned to a variable of type 'SigninCharacter'
I'm making a radio button then i face this error.//A value of type 'Object?' can't be assigned to a variable of type 'SigninCharacter'. Try changing the type of the variable, or casting the right-hand...
Hassan Naveed
Votes: 0
Answers: 1
Flutter: Migrating to null safety leads to errors
After migrating to null safety:dataSnapshot.data.docs; .docs is underlined red.
I have tried dataSnapshot.data?.docs, dataSnapshot.data!.docs but still underlined red is there.
StreamBuilder(
...
chubi
Votes: 0
Answers: 1
Migrating to null safety: The argument type 'Object?' can't be assigned to the parameter type 'DocumentSnapshot<Object?>'
After migrating to null safety, I'm getting the error: The argument type 'Object?' can't be assigned to the parameter type 'DocumentSnapshot<Object?>'. Thanks for helping out.
...
chubi
Votes: 0
Answers: 2