1

I defined some nullable objects and used them elsewhere in State<T>

List<T>? _data;
int? _count;

Do I need to release them manually? like this:

  @override
  void dispose() {
    _data?.clear(); // clear list
    _data = null;   // blank manually
    _count = null;  // blank manually
    super.dispose();
  }

Any suggestions?
Thank you!

Abbasihsn
  • 2,075
  • 1
  • 7
  • 17
SILENCE
  • 308
  • 2
  • 11

0 Answers0