【发布时间】:2013-12-31 17:13:10
【问题描述】:
我不明白then() 子句的语法。
1. myFuture(6).then( (erg) => print(erg) )
(erg) => expr 在语法上是什么?
我认为它可能是一个函数,但是
then( callHandler2(erg)
不起作用,错误:
"Multiple markers at this line
- The argument type 'void' cannot be assigned to the parameter type '(String) ->
dynamic'
- Undefined name 'erg'
- Expected to find ')'"
2. myFuture(5).then( (erg) { callHandler(erg);},
onError: (e) => print (e)
What´s `onError: (e) => expr"` syntactically?
3. onError: 和 .catchError(e) 变体之间有区别吗?
【问题讨论】:
标签: dart dart-async