Flutter 由添加到“我的照片”的滑块控制的动画

Flutter 由添加到“我的照片”的滑块控制的动画,flutter,Flutter,我有这张照片,我想淡入淡出,淡出由滑块值控制。这是淡入淡出的代码,但我不知道如何在我的代码中实现它 Positioned( left: 24, top: MediaQuery.of(context).size.height/3, bottom:0, right:0,

我有这张照片,我想淡入淡出,淡出由滑块值控制。这是淡入淡出的代码,但我不知道如何在我的代码中实现它

Positioned(
                            left: 24,
                            top: MediaQuery.of(context).size.height/3,
                            bottom:0,
                            right:0,
                            child: 
                          Container(
                            decoration: BoxDecoration(
                                  gradient: LinearGradient(colors: <Color>[
                                    Colors.black.withOpacity(0.1),
    
                                    Colors.black
                                  ],
                                  begin: Alignment.centerLeft,
                                  end: Alignment.centerRight,
                                  stops: [0.1 , 0.5]
                                  )
                                ),
                          )
                          ),

你知道我该怎么做吗,比如当滑块为0时,图像将为黑色,当滑块变高时,图像开始显示。这就是我想要获得的:

你可以使用类似的东西。由于BoxEdition的原因,我在尝试将其添加到我的代码时遇到了很多错误
 Row(
                       
                        children: [
                          Container
                          (
                            
                            width: 300,
                            height: 400,
                              child: Image.asset('/Users/ralucaraluca/AndroidStudioProjects/avantaj/assets/images/map2.jpg')),
                              SizedBox(width: 10,),
                          Container(
                              height: 400,
                            child: RotatedBox(
                              quarterTurns: 3, 
           child: Slider(
      value: _currentSliderValue,
      
      inactiveColor: Colors.white10,
      min: 0,
      max: 100,
      divisions: 5,
      label: _currentSliderValue.round().toString(),
      onChanged: (double value) {
        setState(() {
          _currentSliderValue = value;
        });
      },
    ),
                            ),
                          ),
                          
                        ],
                      ),
                      Row(
                            crossAxisAlignment: CrossAxisAlignment.center,
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                           Container(
                                decoration: new BoxDecoration(
                            color: Colors.white,
                            borderRadius: new BorderRadius.all(Radius.circular(10)),
                    ),
                                width: 50,
                                height: 50,
                               
                                child: Icon(Icons.check_rounded ,color: Colors.black,)),

                                SizedBox(width:20),
                                Container(
                                decoration: new BoxDecoration(
                            color: Colors.white,
                            borderRadius: new BorderRadius.all(Radius.circular(10)),
                    ),
                                width: 50,
                                height: 50,
                               
                                child: Icon(Icons.cancel_rounded ,color: Colors.black,)),


                          ],)
double _value = 0.0;
 Slider(  
      min: 0,  
      max: 100,  
      value: _value,  
      onChanged: (value) {  
        setState(() {  
          _value = value;  
        });  
      },  
    ),  
    Container(boxdecoration:DecoratedBox(image:DecorationImage(Image, colorFilter: 
      ColorFilter.mode(Colors.black.withOpacity(_value)), 
      BlendMode.dstATop),)))