import 'package:get/get.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import '../dateTool.dart'; import 'seletKeyCyclicDate_state.dart'; class SeletKeyCyclicDateLogic extends BaseGetXController { SeletKeyCyclicDateState state = SeletKeyCyclicDateState(); void subBtnAction(){ var starDateTimestamp = DateTool().dateToTimestamp(state.starDate.value, 1).toString(); var endDateTimestamp = DateTool().dateToTimestamp(state.endDate.value, 1).toString(); var starTimeTimestamp = DateTool().dateToTimestamp(state.starTime.value, 0).toString(); var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString(); if (int.parse(starDateTimestamp) > int.parse(endDateTimestamp)) { showToast("失效日期要大于生效日期".tr); return; } if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) { showToast("失效时间要大于生效时间".tr); return; } Map resultMap = {}; resultMap['starDate'] = state.starDate.value; resultMap['endDate'] = state.endDate.value; resultMap['starTime'] = state.starTime.value; resultMap['endTime'] = state.endTime.value; resultMap['validityValue'] = state.weekDay.value; Get.back(result: resultMap); } }