title: How to implement checkbox over GridView correctly
body: <p>I have checkbox for selecting and deselecting photos.
  There is a visible loading screen for each tap.</p>
  <p><a href="https://i.stack.imgur.com/IwUy7.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IwUy7.gif" alt="Visible loading  screen" /></a></p>
  <p><code>_mediaList</code> has the photo asset. <code>mediaModel</code> has the necessary methods to add and remove the path of selected and deselected photos respectively.</p>
  <pre><code> Widget build(BuildContext context) {
      super.build(context);
      return GridView.builder(
        itemCount: _mediaList.length,
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 3, mainAxisSpacing: 4.0, crossAxisSpacing: 4.0),
        itemBuilder: (BuildContext context, int index) {
          final saved = mediaModel.getMedia().contains(
              _mediaList[index].relativePath + '/' + _mediaList[index].title);
          return FutureBuilder(
              future: _mediaList[index].thumbDataWithSize(200, 200),
              builder: (BuildContext context, snapshot) =&gt; snapshot.hasData
                  ? GridTile(
                      header: saved
                          ? Icon(Icons.check_circle, color: Colors.white,)
                          : Icon(Icons.check_circle_outline, color: Colors.white,),
                      child: GestureDetector(
                          child: Image.memory(
                            snapshot.data,
                            fit: BoxFit.cover,
                          ),
                          onTap: () =&gt; setState(() =&gt; saved
                              ? mediaModel.removeMedia(
                                  _mediaList[index].relativePath +
                                      '/' +
                                      _mediaList[index].title)
                              : mediaModel.addMedia(
                                  _mediaList[index].relativePath +
                                      '/' +
                                      _mediaList[index].title))),
                    )
                  : Container());
        },
      );
    }
  </code></pre>
  <p><strong>EDIT</strong>: After some analysis, I found out using <code>Provider</code> to load images might be the right way.</p>
  <p>Can you help me in converting this code to <code>Provider</code>?</p>
  <p>Thanks in advance!!!</p>