Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can't move slider for camera zoom – Flutter

I am trying to move slider for zoom in flutter camera. I tried many things but I could not get solution. I am attaching my code with screenshot. Please give right suggestion.

enter image description here

double _minAvailableZoom = 2.0;
  double _maxAvailableZoom = 2.0;
  double _currentZoomLevel = 2.0;

Expanded(
                      child: Slider(
                        value: _currentZoomLevel,
                        max: _maxAvailableZoom,
                        min: _minAvailableZoom,
                        activeColor: Colors.white,
                        inactiveColor: Colors.white30,
                        onChanged: (value) async {
                          setState(() {
                            _currentZoomLevel = value;
                          });
                          await cameraController!.setZoomLevel(value);
                        },
                      ),
                    ),

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

just do this,

double _minAvailableZoom = 0.0;
double _currentZoomLevel = 0.0;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading