import 'package:flutter/material.dart';
import 'package:flyinsono/lab/pages/lab_export/widgets/classify_data_multiple_selector/classify_data_multiple_selector.dart';
import 'package:flyinsono/lab/pages/lab_export/controller.dart';
import 'package:get/get.dart';

class PatientSwitcher extends GetView<LabExportController> {
  const PatientSwitcher({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GetBuilder<LabExportController>(
        id: LabExportController.patientSwitcherId,
        builder: (_) {
          return Container(
            width: 300,
            child: ClassifyDataMultipeSelector(
              loading: controller.isPatientListLoading,
              selectedClassifyIndex: controller.selectedClassifyIndex,
              multipleCheckList: controller.multipleCheckList,
              selectedItemIndex: controller.selectedPatientIndex,
              classifyData: controller.patientClassifyData,
              onItemClick: (classifyIndex, itemIndex) {
                controller.clickPatientItem(classifyIndex, itemIndex);
              },
              onMultipleItemClick: (classifyIndex, itemIndex) {
                controller.clickPatientMultipleItem(classifyIndex, itemIndex);
              },
            ),
          );
        });
  }
}
