How can I get it to work?
@override
void dispose() {
timer.cancel();
super.dispose();
}
And this is what I have:
class _ListCell extends State<ListCell> {
@override
void initState() {
super.initState();
Timer timer = Timer.periodic(Duration(seconds: 1), (_) => ListCell());
}
Constantly getting the error:
Error: The getter 'timer' isn't defined for the class '_ListCell'.