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

Viewed 3566

I am facing the same issue with this

     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) {
3 Answers

That is one way how to avoid the error

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

yeah I was also having the same issue it just got solved by putting ' _ ' in the third argument

onDaySelected: (date, events, _) {
        _onDaySelected(date, events);
        _animationController.forward(from: 0.0);
      },

I managed to solve it by passing _ as the third argument.

Related