There is no null-aware operator for the indexing operator ([]
)
You can use elementAt()
instead:
list?.elementAt(index)?.elementAt(index)?.elementAt(index) ?? 0
UPDATE – 2021/05/24
If you are using null-safety, you can now use this:
list?[index]?[index]?[index] ?? 0