toggleCamera method

dynamic toggleCamera()

Implementation

toggleCamera() async {
  if (cameras != null) {
    int index = widget.model.index ?? 0;
    index++;
    if (index >= cameras!.length) index = 0;

    // this will fire onModelChange
    widget.model.index = index;
  } else {
    Log().exception('No cameras to toggle', caller: 'camera.View');
  }
}