import 'package:flyinsono/js_platform/handlers/base.dart';
import 'package:flyinsono/js_platform/methods.dart';
import 'package:flyinsono/managers/interfaces/entities/install_printer_driver_state.dart';
import 'package:flyinsono/managers/interfaces/flyinsono_college.dart';
import 'package:flyinsono/managers/interfaces/remote_maintenance.dart';
import 'package:get/get.dart';

class InstallPrinterDriverChangeHandler extends MethodHandlerBase {
  InstallPrinterDriverChangeHandler()
      : super(TargetMethodName.OnInstallPrinterDriverChange);
  @override
  void execute(List<String> args) {
    var state = int.parse(args[0]);
    print(state);
    Get.find<IRemoteMaintenanceManager>().onInstallPrinterDriverChange.emit(
          this,
          InstallPrinterDriverState.values.firstWhere(
            (element) => element.index == state,
          ),
        );
  }
}
