title: Flutter Image Widget won't update on change state
body: <p>I am creating an Image Editor application using sliders, something like Instagram, and I am using library image/image.dart.
  The problem is that once you move the slider it updates the image but just that time, if you move it again, it won't update.</p>
  
  <p>I have set everything as expected, setState() functions as flutter asks, but I don't know why it won't update again.</p>
  
  <pre><code>import 'dart:io';
  import 'dart:ui';
  import 'package:flutter/material.dart';
  
  import 'package:image/image.dart' as br;
  import 'package:path_provider/path_provider.dart';
  import 'package:image_picker/image_picker.dart';
  
  class ImageManager extends StatefulWidget {
  
    @override
    State&lt;StatefulWidget&gt; createState() {
      return _ImageManagerState();
    }
  }
  
  class _ImageManagerState extends State&lt;ImageManager&gt; {
    File imageFile;
    br.Image image;
    Image _imageWidget;
  
    Future&lt;String&gt; get _localPath async {
      final directory = await getApplicationDocumentsDirectory();
  
      return directory.path;
    }
  
    // get tmp file
    Future&lt;File&gt; get _localFile async {
      final path = await _localPath;
      return File('$path/tmp.jpg');
    }
  
    // pick image on button click
    Future&lt;void&gt; _pickImage(ImageSource source) async{
      File selectedFile = await ImagePicker.pickImage(source: source);
      br.Image selectedImage;
      if (selectedFile != null){
        selectedImage = br.decodeImage(selectedFile.readAsBytesSync());
        br.grayscale(selectedImage);
  
        selectedFile.writeAsBytesSync(br.encodeJpg(selectedImage));
      }
  
      setState((){
        image = selectedImage;
        imageFile = selectedFile;
        _imageWidget = Image.file(imageFile);
      });
    }
  
    // MAIN PROBLEM, UPDATING THE CONTRAST WILL ONLY DO IT ONCE
    Future&lt;void&gt; updateContrast(value) async{
      File contrastFile = imageFile;
      br.Image contrast = br.decodeImage(contrastFile.readAsBytesSync());
      contrast = br.adjustColor(contrast, contrast: value);
      contrastFile.writeAsBytesSync(br.encodeJpg(contrast));
  
      // Save the thumbnail as a jpg.
      File path = await _localFile;
      path.writeAsBytesSync(br.encodeJpg(contrast));
      setState(() {
        image = contrast;
        imageFile = contrastFile;
        if(path != null){
          _imageWidget = Image.file(path);
          print(value);
        }
  
      });
    }
  
    // 
    Widget _buildImage(BuildContext context){
      return Column(
        children: [
          Container(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.width,
            child: _imageWidget,
          ),
          Column(
            children: [
              Container(
                padding: const EdgeInsets.only(left: 8, right: 8),
                child: Column(
                  children: &lt;Widget&gt;[
                    // contrast
                    Text("Contraste"),
                    Padding(
                      padding: const EdgeInsets.only(bottom: 4.0, top: 0.0),
                      child: Container(
                        child: Slider(
                          min: 0.0,
                          max: 1.0,
                          divisions: 100,
                          value: _contrast,
                          activeColor: Colors.blue[500],
                          inactiveColor: Colors.blue[50],
                          label: "${(_contrast *100).round()}",
                          onChanged: (value) async{
                            changeContrast(value);
                          },
                          onChangeEnd: (value) async{
                            updateContrast(value);
                          },
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ]
      );
    }
  
  
  </code></pre>
  
  <p>I expect the image to update every time the slider is changed.</p>