In Dart, syntactically nice way to cast dynamic to given type or return null?

前端 未结 5 1699
囚心锁ツ
囚心锁ツ 2021-02-18 23:20

I have a dynamic x and I would like to assign x to T s if x is T, and otherwise assign null to s. S

5条回答
提交回复
热议问题