79552816

Date: 2025-04-03 11:47:00
Score: 0.5
Natty:
Report link

I created a function and call in the buildSuggestions

Widget buildSuggestions(BuildContext context) {
    _buildContext = context;

    executeAfterBuild();

In the function I call a Future.delayed because Flutter needed time for contruct the context again

Future<void> executeAfterBuild() async {
    if (retornoglobal == true) {
      Future.delayed(const Duration(milliseconds: 500), () {
        // this code will get executed after the build method
        // because of the way async functions are scheduled
        _chamaformulario(
          snapshotglobal,
          indexglobal,
        );
      });
    }
  }

It´s Worked

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Mateus