Estou usando o VScode e o flutter mais atualizado no momento. Estou com o erro acima. no updateShouldNotify
import 'package:flutter/material.dart';
import 'package:widgets/components/task.dart';
class TaskInherited extends InheritedWidget {
TaskInherited({super.key, required super.child});
final List<Task> taskList = [
const Task(
name: "Tarefa 1",
foto: 'assets/images/image.png',
dificuldade: 4,
),
const Task(
name: "Tarefa 2",
foto: 'assets/images/image2.jpg',
dificuldade: 3,
),
const Task(
name: "Tarefa 4",
foto: 'assets/images/image3.png',
dificuldade: 1,
),
const Task(
name: "Tarefa 4",
foto: 'assets/images/image4.jpg',
dificuldade: 2,
)
];
static TaskInherited of(BuildContext context){
}
void newTaks(
{required String name, required String foto, required int difficulty}) {
taskList.add(Task(name: name, foto: foto, dificuldade: difficulty));
}
@override
bool updateShouldNotify(InheritedWidget oldWidget) {
return oldWidget.taskList.length != taskList.length; //ERRO NESSA LINHA EXATAMENTO NO oldWidget.taksList.length
}
}