setBoxFit method

void setBoxFit(
  1. double scale
)

this method is called to update Boxfit value

it take a scale and by testing on the scale value we can detect if the user is currently scaling or not and depending on this value we toggle Boxfit between cover and contain also in case if user zoom out we reset the value of the controller

Implementation

void setBoxFit(double scale) {
  if (scale > 1.0) {
    _isscaling = true;
  } else {
    _isscaling = false;
    controller.value = Matrix4.identity();
  }
  notifyListeners();
}