The hashcode function that gets generated cannot handle more than 20 arguments. Therefore once a class reaches over 20 properties this error occurs:
Error: Too many positional arguments: 20 allowed, but 21 found.
Try removing the extra positional arguments.
return Object.hash(
^
org-dartlang-sdk:///third_party/dart/sdk/lib/core/object.dart:183:14: Context: Found this candidate, but the arguments don't match.
static int hash(Object? object1, Object? object2,
The way to fix this is to use
@override
int get hashCode => Object.hashAll([ <List of properties> ]);
instead of
@override
int get hashCode => Object.hash(<List of properties>);
The hashcode function that gets generated cannot handle more than 20 arguments. Therefore once a class reaches over 20 properties this error occurs:
The way to fix this is to use
instead of