ticketer_shift_logic.dart 2.1 KB
import 'package:cp_offline_manage/router/route_config.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:cp_offline_manage/common/colors.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import '../../../../utils/log.dart';

class Ticketer_shiftLogic extends GetxController {
  void jumpToJiaoJiePage(int type) {
    Get.toNamed(RouteConfig.ticketer_shift_deal_key, arguments: {"type": type});
  }

  void selectDate() {
    Get.bottomSheet(Container(
      height: 350,
      color: Colors.white,
      child: Column(
        children: [
          Container(
            height: 40,
            alignment: Alignment.centerLeft,
            padding: const EdgeInsets.symmetric(horizontal: 12),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                const Text(
                  '选择日期',
                  style: TextStyle(
                      fontSize: 18,
                      color: ColorConfig.color33,
                      fontWeight: FontWeight.bold),
                ),
                InkWell(
                  child: Container(
                    width: 60,
                    height: 26,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(4)),
                        color: ColorConfig.themeColor),
                    child: Text(
                      '确定',
                      style: TextStyle(color: ColorConfig.white, fontSize: 15),
                    ),
                  ),
                  onTap: () {
                    Get.back();
                  },
                )
              ],
            ),
          ),
          SfDateRangePicker(
            onSelectionChanged: _onSelectionChanged,
            selectionMode: DateRangePickerSelectionMode.single,
          )
        ],
      ),
    ));
  }

  void _onSelectionChanged(DateRangePickerSelectionChangedArgs args) {
    LogUtils.e('选中日期: ${args.value}');
  }
}