/*
 * @Author: WuXiangNan
 * @Date: 2021-03-04 16:31:08
 * @LastEditTime : 2022-01-19 09:49:00
 * @LastEditors  : WuWei
 * @Description: 事件预警
 */
import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';
import './list_item.dart';
import '../../../assets.gen.dart';

class EventWarningPage extends StatelessWidget {
  const EventWarningPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return _PageView();
  }
}

class _PageView extends StatefulWidget {
  _PageView({Key? key}) : super(key: key);

  @override
  __PageViewState createState() => __PageViewState();
}

class __PageViewState extends State<_PageView> {
  @override
  Widget build(BuildContext context) {
    return Wisdom.column(
      children: [
        Wisdom.row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          margin: EdgeInsets.all(10.pt),
          children: [
            Wisdom.row(
              // update2.2
              onTap: () => {
                WisBottomModal.showDatePicker(
                  context: context,
                  title: Text('请选择时间'),
                  firstDate: DateTime.parse(
                    DateTime.now().toString(),
                  ),
                  initialDate: DateTime.parse(
                    DateTime.now().toString(),
                  ),
                  lastDate: DateTime(2099),
                  hasBottom: false,
                )
              },
              children: [
                WisText(
                  '2021-03-05',
                  color: Colors.grey,
                  size: 15.pt,
                ),
                SizedBox(
                  width: 10.pt,
                ),
                Image(
                  image: AssetList.$tz_png_image,
                  height: 15,
                )
              ],
            ),
            Wisdom.row(
              children: [
                WisText(
                  '共  ',
                  color: Colors.grey,
                ),
                WisText(
                  '7  ',
                  color: Color(0XFF0F67F8),
                ),
                WisText(
                  '起',
                  color: Colors.grey,
                ),
              ],
            )
          ],
        ),
        WisScrollView(
          slivers: [
            WisSliverList.childBuilder(
              childCount: 3,
              builder: (_, i) {
                return InkWell(
                  child: EventListItem(),
                );
              },
            )
          ],
        ).asExpanded(),
      ],
    );
  }
}
