You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
693 B

import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
class VoiceReplicationController extends GetxController {
final GetStorage _storage = GetStorage();
RxBool isReplicating = false.obs;
RxString speakerProfileId = ''.obs;
@override
void onInit() {
super.onInit();
_getDefaultData();
}
void _getDefaultData() {
isReplicating.value = _storage.read('open_voice_replication') ?? false;
speakerProfileId.value = _storage.read('speakerProfileId') ?? '';
}
void switchChange(bool value) {
isReplicating.value = value;
if (speakerProfileId.value.isNotEmpty) {
_storage.write('open_voice_replication', value);
}
}
}