Podemos usar o SetState Inside Build

Replace your setState() calls with setStateIfMounted() and define it as:

void setStateIfMounted(f) {
  if (mounted) setState(f);
}
Lokesh003