How to solve: the operator '<' can't be unconditionally invoked because the receiver can be 'null'

Question

Asked by Mohammad a on December 03, 2021 (source).

Can you help solve this I have tried to put ! but no use enter image description here

 (snapShot.hasData &&  snapShot.data! < 10)? '${snapShot.data}' ??'' : 'Future in Flutter'),

 (snapShot.hasData &&  snapShot!.data < 10)? '${snapShot.data}' ??'' : 'Future in Flutter'),

Answer

Question answered by 聂超群 (source).

Please try this:

(snapShot.data ?? 0) < 10
DART FLUTTER
SHARE: