In Typescript, I can define a var with 2 types like this
foo: string | number = 'bar'
How can I do the similar in Dart?
You can't do that in dart 2.
Dart 2 is statically typed
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.