/*
 * @Author: ChenYaJin
 * @Date: 2023-04-25 11:45:28
 * @LastEditors: ChenYaJin
 * @LastEditTime: 2023-04-25 16:36:16
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

class RankTipComponent extends StatelessWidget {
  const RankTipComponent({Key? key, this.onClick}) : super(key: key);
  final Function()? onClick;

  @override
  Widget build(BuildContext context) {
    onShowTip() async {
      await showDialog(
        barrierDismissible: false,
        context: context,
        builder: (context) {
          return WisDialog(
            title: Text('统计说明'),
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(20.pt),
            ),
            contentPadding: EdgeInsets.all(15.pt),
            content: Wisdom.column(
              height: 230,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                WisText.c999(
                  "区域异常排名：",
                  size: 14.pt,
                ),
                WisText.c999(
                  "跟随着筛选内容进行切换，如选择今年则切换为12个月，选择上月则切换31天，选择最近七日则切换7日数据。异常区域总数=该区域下点位记录中出现异常数的总和。",
                  size: 14.pt,
                ),
                SizedBox(
                  height: 5.pt,
                ),
                WisText.c999(
                  "点位异常排名：",
                  size: 14.pt,
                ),
                WisText.c999(
                  "跟随着筛选内容进行切换，如选择今年则切换为12个月，选择上月则切换31天，选择最近七日则切换7日数据。点位异常总数=点位记录中出现异常数的总和。",
                  size: 14.pt,
                ),
              ],
            ),
          );
        },
      );
    }

    return Wisdom(
      margin: EdgeInsets.symmetric(horizontal: 15.pt, vertical: 5.pt),
      child: Wisdom.row(
        children: [
          Wisdom(
            onTap: () => onShowTip(),
            child: WisText.c999(
              "注：异常排名说明",
              size: 13.pt,
              weight: FontWeight.w300,
            ),
          ),
          Wisdom(
            onTap: () => onShowTip(),
            margin: EdgeInsets.only(left: 5.pt),
            child: Icon(
              Icons.help,
              color: Colors.grey,
              size: 16.pt,
            ),
          ),
        ],
      ),
    );
  }
}
