skip to Main Content

Just wondering if there is any difference between:

      // == Add all picked idoes to the mix table
      setState(() {
        Future.forEach(result, (asset) async {
          final video = await MixTableVideo.create(original: asset);
          videos.add(video);
        });
      });

and:

      // == Add all picked idoes to the mix table

      Future.forEach(result, (asset) async {
          final video = await MixTableVideo.create(original: asset);
          videos.add(video);
        });

      setState(() {});

2

Answers


  1. Chosen as BEST ANSWER

    Finally I did this which fires a UI update at each video addition:

          // == Add all picked videos to the mix table
          Future.forEach(result, (asset) async {
            final video = await MixTableVideo.create(original: asset);
            setState(() {
              videos.add(video);
            });
          });
    

  2. Before we can use state, we need to declare a default set of values for the initial state. This can be done by either creating a state object in the constructor or directly within the class.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search