import 'package:flyinsono/architecture/services/modules/hardware_setting_configuration.dart';
import 'package:flyinsono/js_platform/methods.dart';
import 'package:get/get.dart';
import 'base.dart';

// 硬件设置同步 （摄像头、麦克风）
class ReloadSettingsHandler extends MethodHandlerBase {
  ReloadSettingsHandler() : super(TargetMethodName.ReloadSettings);
  @override
  void execute(List<String> args) {
    String hardwareSettingConfigJson = args[0];
    print('hardwareSettingConfigJson: $hardwareSettingConfigJson');

    /// 本地硬件设置持久化缓存服务
    HardwareSettingService hardwareSettingService =
        Get.find<HardwareSettingService>();
    hardwareSettingService.syncFromJson(hardwareSettingConfigJson);
  }
}
