import 'package:get/get.dart';
import 'package:vitalapp/architecture/defines.dart';
import 'package:vitalapp/architecture/utils/prompt_box.dart';
import 'package:vitalapp/pages/data_sync/patients/controller.dart';

import 'state.dart';

class DataSyncController extends FControllerBase {
  final state = DataSyncState();

  /// 同步数据
  Future<void> syncData() async {
    setBusy("正在同步档案...");
    await Get.find<PatientSyncController>().syncAll();
    cancelBusy();
    PromptBox.toast("同步完成");
  }

  @override
  void onInit() {
    Get.put<PatientSyncController>(PatientSyncController());
    super.onInit();
  }
}
