I tried calling this code:
var test = int.parse(DateFormat('yyyy').format(formattedTemporaryDate));
but I get the error:
type 'String' is not a subtype of type 'DateTime'
my formattedTemporaryDate
is '2022-01-08'
I think I need to transform the formattedTemporaryDate to an int, but I don't know how. And I even don't know if this really is the problem... Do you need more information to fix my problem?