不能弹出提示 错误如下
oh-jy opened this issue · comments
I/flutter ( 8069): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter ( 8069): The following NoSuchMethodError was thrown while handling a gesture:
I/flutter ( 8069): The getter 'inMilliseconds' was called on null.
I/flutter ( 8069): Receiver: null
I/flutter ( 8069): Tried calling: inMilliseconds
I/flutter ( 8069):
I/flutter ( 8069): When the exception was thrown, this was the stack:
I/flutter ( 8069): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
I/flutter ( 8069): #6 showToastWidget
package:oktoast/…/core/toast.dart:138
I/flutter ( 8069): #7 showToast
package:oktoast/…/core/toast.dart:71
showToastWidget line 138
Future.delayed(duration, () {
future.dismiss();
});
Duration must be not null.
thanks 希望能把 duration 加上个required...看到源码里面有_defaultDuration 所以就没有传入
This parameter has a default value, you mustn't have to pass in. But if you pass in, the duration can't be null.