save method

Future<void> save()

Saves the settings to the device.

Implementation

Future<void> save() async {
	isLoading = true;
	notifyListeners();
    if (value.dashboard.splitCameras != models.settings.dashboard.splitCameras) {
      // Need an if to avoid resetting throttle when trying to set throttle
      models.rover.setDefaultControls();
    }
    final resetSockets = !(const DeepCollectionEquality().equals(
      models.settings.network.toJson(),
      value.network.toJson(),
    ));
	await models.settings.update(value);
    if (resetSockets) {
      await models.sockets.reset();
    }
	models.video.reset();
	isLoading = false;
	notifyListeners();
}