ticketer_shift_view.dart 6.4 KB
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:cp_offline_manage/common/colors.dart';
import 'ticketer_shift_logic.dart';

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

  @override
  Widget build(BuildContext context) {

    return Scaffold(
        appBar: AppBar(
          title: Text('打票员交接班'),
          centerTitle: true,
          backgroundColor: ColorConfig.themeColor,
          actions: [
            Container(
              alignment: Alignment.center,
              margin: const EdgeInsets.only(right: 20),
              child: InkWell(
                child: Image(
                  image:
                  AssetImage("assets/images/home_icon/icon_choose_date.png"),
                  width: 24,
                  height: 24,
                ),
                onTap: () {
                  controller.selectDate();
                },
              ),
            )
          ],
        ),
        body: Column(
          children: [
            _buildTakeoverOrHandover(1),
            _buildTakeoverOrHandover(2),
          ],
        ));
  }

  Widget _buildTakeoverOrHandover(int type) {
    return Stack(
      children: [
        Container(
          height: 160,
          margin: EdgeInsets.only(left: 15, right: 15, top: 15, bottom: 0),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(5.0),
            boxShadow: [
              BoxShadow(
                color: Colors.grey.withOpacity(0.2),
                spreadRadius: 1,
                blurRadius: 1,
                offset: Offset(0, 0),
              ),
            ],
          ),
          child: Column(
            children: [
              Container(
                height: 48,
                decoration: BoxDecoration(
                  border: Border(bottom: BorderSide(width: 1, color: Color(0xFFE7E7E7))),
                ),
                child: Row(
                  children: [
                    Container(
                      padding: EdgeInsets.symmetric(horizontal: 10),
                      child: Text(
                        "早班",
                        style: TextStyle(color: Colors.green),
                      ),
                    ),
                    Container(
                      width: 1,
                      color: Color(0xFFE7E7E7),
                      margin: EdgeInsets.symmetric(vertical: 5),
                    ),
                    Expanded(child: Container()),
                    Text("接班:11:30"),
                    Expanded(child: Container()),
                    Text("交班:14:30"),
                    Expanded(child: Container()),
                    Icon(Icons.search, color: Colors.green,),
                    SizedBox(width: 10,)
                  ],
                ),
              ),
              Expanded(
                child: Row(
                  children: [
                    Container(
                      margin: EdgeInsets.only(left: 10),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage(
                                "assets/images/home_icon/icon_default_portrait.png"),
                            width: 48, height: 48,
                          ),
                          SizedBox(height: 15,),
                          Text("值班:张三"),
                        ],
                      ),
                    ),
                    Expanded(child: Container()),
                    Container(
                      margin: EdgeInsets.only(top: 15, bottom: 20),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage(
                                "assets/images/home_icon/icon_default_portrait.png"),
                            width: 40, height: 40,
                          ),
                          SizedBox(height: 5,),
                          Text("李四"),
                        ],
                      ),
                    ),
                    Expanded(child: Container()),
                    Container(
                      margin: EdgeInsets.only(top: 15, bottom: 20),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage(
                                "assets/images/home_icon/icon_default_portrait.png"),
                            width: 40, height: 40,
                          ),
                          SizedBox(height: 5,),
                          Text("王五"),
                        ],
                      ),
                    ),
                    Expanded(child: Container()),
                    Container(
                      margin: EdgeInsets.only(top: 15, bottom: 20),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          Image(
                            image: AssetImage(
                                "assets/images/home_icon/icon_default_portrait.png"),
                            width: 40, height: 40,
                          ),
                          SizedBox(height: 5,),
                          Text("陈六"),
                        ],
                      ),
                    ),
                    Expanded(child: Container()),
                  ],
                ),
              ),
            ],
          ),
        ),
        Positioned(
          bottom: 0,
          right: 15,
          child: Container(
              width: 66.0,
              height: 24.0,
              alignment: Alignment.bottomRight,
              child: ElevatedButton(
                onPressed: () { controller.jumpToJiaoJiePage(type); },
                child: Text('${type == 1 ? "交班" : "接班"}'),
                style: ButtonStyle(
                  backgroundColor: MaterialStateProperty.all(Colors.green),
                ),
              ),
            )
        )
      ],
    );
  }
}