flutter - 错误: The argument type 'Null Function(DateTime, List<dynamic>)' can't be assigned to the parameter

标签 flutter dart

我与此面临着同样的问题

     Error: 
        The argument type 'Null Function(DateTime, List<dynamic>)' can't be assigned 
        to the parameter type 'void Function(DateTime, List<dynamic>, List<dynamic>)'.
        - 'DateTime' is from 'dart:core'. - 'List' is from 'dart:core'. 
        onDaySelected: (day, events) {

最佳答案

那是避免错误的一种方法

onDaySelected: (date, event, _) {
    print(date.toIso8601String());
},

关于flutter - 错误: The argument type 'Null Function(DateTime, List<dynamic>)' can't be assigned to the parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64441372/

相关文章:

dart - Flutter 标准包

flutter - TextEditingController 与 OnChanged

android - 如何更新购物车中的项目数?

asynchronous - 关于Dart async/await。我使用一段代码进行测试,但是打印结果与预期不符

flutter 错误 : "A value of type ' Null' can't be assigned to a variable of type 'Product' ."

json - 删除 Dart 中的重复值

dart - PolymerDart 自定义元素与 Angular.dart 模型的双向绑定(bind)

android - Flutter 多平台 Android/iOS 抽屉式菜单

dynamic - Dart 2中的动态类型可以分配给差异类型的多个值吗?

android - Flutter:尝试将数据添加到 map 列表时出错