/*
 * @Author: XianKaiQun
 * @Date: 2020-04-30 14:39:47
 * @LastEditors: wuwei
 * @LastEditTime: 2023-12-22 15:26:15
 * @Descripttion: 任务详情-底部操作按钮
 */
part of '../index.dart';

class _BottomComponent extends StatelessWidget {
  const _BottomComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateTaskDetailStore>(context);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final data = store.data;

    ///显示转派
    final showShift = data?.status == 'no_open' &&
        (data?.isoperator == true || data?.iscreatedBy == true);

    ///显示编辑
    final showEdit = data?.status == 'no_open' &&
        data?.iscreatedBy == true &&
        data?.isoperator == true &&
        data?.preset == false;

    ///判断抄送人ids里有没有当前登录用户
    final authGlobalStore = GetIt.I.get<AuthGlobalStore>();
    final userId = authGlobalStore.info?.id;
    bool isMailMe = data?.mailFromIds != null &&
        (data?.mailFromIds!.indexWhere((e) => userId == e) != null) &&
        (data?.mailFromIds!.indexWhere((e) => userId == e) != -1);
    final bool isCancel = data?.status == 'cancel';

    ///显示评论
    final showComment = data?.status != 'cancel' &&
        (data?.iscreatedBy == true || data?.isoperator == true || isMailMe) &&
        data?.status != 'waitReceive';

    ///显示开始任务
    final bool showStart =
        data?.status == 'no_open' && data?.isoperator == true;

    ///显示完成
    final showFinish = data?.status == 'doing' &&
        data?.isoperator == true &&
        data?.preset == false;

    /// 显示异常处理
    final showDealAbnormal =
        ['finished', 'doing'].contains(data?.status) && data?.preset == true;

    /// 显示取消 putTaskCancelV1
    final bool showCancel =
        data?.status == 'no_open' && data?.iscreatedBy == true;

    /// 显示子任务
    final showChild = data?.status != 'finished' &&
        data?.status != 'cancel' &&
        (data?.iscreatedBy == true || data?.isoperator == true) &&
        data?.isChild == false &&
        data?.preset == false &&
        data?.taskMultiStepEnable != true &&
        data?.isMultiStep != true;
    final showPickup = data?.status == 'waitReceive' ? true : false;

    /// 显示重新审查（非预设清单）
    final showCheck = data?.status == 'finished' &&
            data?.examine != true &&
            data?.preset != true
        ? true
        : false;

    /// 显示重新开启
    final showReopen =
        data?.status == 'finished' && data?.preset != true ? true : false;

    /// 重新开启弹窗
    void _onShowReopen() {
      showModalBottomSheet(
        isScrollControlled: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(10.pt),
            topRight: Radius.circular(10.pt),
          ),
        ),
        context: context,
        builder: (BuildContext context) {
          return new SingleChildScrollView(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: SafeArea(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerLeft,
                      ),
                      Text(
                        '重新开启',
                        textAlign: TextAlign.center,
                        maxLines: 1,
                        style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 16,
                        ),
                      ).asExpanded(),
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerRight,
                        child: CloseButton(
                          onPressed: () => Navigator.pop(context),
                        ),
                      ),
                    ],
                  ),
                  Divider(height: 1),
                  ConstrainedBox(
                    constraints: BoxConstraints(minHeight: 250),
                    child: Stack(
                      children: [
                        new Wisdom.column(
                          padding: EdgeInsets.all(15.pt),
                          margin: EdgeInsets.only(bottom: 59.pt),
                          children: [
                            WFInput(
                              isRequired: true,
                              title: WisText('开启原因'),
                              hintText: '输入本次任务重新开启原因',
                              type: InputType.multiLine,
                              maxLength: 64,
                              onInput: (v) => store.onInputOpenComment(v),
                            ),
                          ],
                        ),
                        // ),
                        new Positioned(
                          bottom: 15,
                          left: 0.0,
                          right: 0.0,
                          child: new Wisdom(
                            borderRadius: BorderRadius.circular(25.pt),
                            color: colorScheme.primary,
                            margin: EdgeInsets.symmetric(horizontal: 15.pt),
                            child: new TextButton(
                              child: new Text(
                                '提交',
                                textAlign: TextAlign.center,
                                style: new TextStyle(
                                    color: Colors.white, fontSize: 15.0),
                              ),
                              onPressed: () => store.onSubmitOpen(),
                            ),
                          ),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          );
        },
      );
    }

    /// 任务审查弹窗
    void _onShowCheck() {
      showModalBottomSheet(
        isScrollControlled: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(10.pt),
            topRight: Radius.circular(10.pt),
          ),
        ),
        context: context,
        builder: (BuildContext context) {
          return new SingleChildScrollView(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: SafeArea(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerLeft,
                      ),
                      Text(
                        '审查任务',
                        textAlign: TextAlign.center,
                        maxLines: 1,
                        style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 16,
                        ),
                      ).asExpanded(),
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerRight,
                        child: CloseButton(
                          onPressed: () => Navigator.pop(context),
                        ),
                      ),
                    ],
                  ),
                  Divider(height: 1),
                  ConstrainedBox(
                    constraints: BoxConstraints(minHeight: 250, maxHeight: 600),
                    child: Stack(
                      children: [
                        new Wisdom.column(
                          padding: EdgeInsets.all(15.pt),
                          margin: EdgeInsets.only(bottom: 59.pt),
                          children: [
                            WFInput(
                              isRequired: true,
                              title: WisText('审查内容'),
                              hintText: '输入本次任务审查内容',
                              type: InputType.multiLine,
                              maxLength: 64,
                              onInput: (v) => store.onInputCheckComment(v),
                            ),
                          ],
                        ),
                        // ),
                        new Positioned(
                          bottom: 15,
                          left: 0.0,
                          right: 0.0,
                          child: Wisdom(
                            borderRadius: BorderRadius.circular(25.pt),
                            color: colorScheme.primary,
                            margin: EdgeInsets.symmetric(horizontal: 15.pt),
                            child: new TextButton(
                              child: new Text(
                                '提交',
                                textAlign: TextAlign.center,
                                style: new TextStyle(
                                    color: Colors.white, fontSize: 15.0),
                              ),
                              onPressed: () => store.onSubmitCheck(),
                            ),
                          ),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          );
        },
      );
    }

    void _onShowComments() {
      showModalBottomSheet(
        isScrollControlled: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(10.pt),
            topRight: Radius.circular(10.pt),
          ),
        ),
        context: context,
        builder: (BuildContext context) {
          return new SingleChildScrollView(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: SafeArea(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerLeft,
                      ),
                      Text(
                        '评论',
                        textAlign: TextAlign.center,
                        maxLines: 1,
                        style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 16,
                        ),
                      ).asExpanded(),
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerRight,
                        child: CloseButton(
                          onPressed: () => Navigator.pop(context),
                        ),
                      ),
                    ],
                  ),
                  Divider(height: 1),
                  ConstrainedBox(
                    constraints: BoxConstraints(minHeight: 250),
                    child: Stack(
                      children: [
                        new Wisdom.column(
                          padding: EdgeInsets.all(15.pt),
                          margin: EdgeInsets.only(bottom: 59.pt),
                          children: [
                            WFInput(
                              isRequired: true,
                              title: WisText('评论内容'),
                              hintText: '输入本次任务评论内容',
                              type: InputType.multiLine,
                              maxLength: 64,
                              onInput: (v) => store.onInputComment(v),
                            ),
                            Observer(builder: (_) {
                              return WFImagePicker(
                                maxCount: 3,
                                title: WisText('评论图片'),
                                onSelected: (v) => store.onSelectImages(v),
                                onDelete: (index) =>
                                    store.onDeleteImages(index),
                                images: store.imageList,
                                currentCount: store.imageList.length,
                              );
                            })
                          ],
                        ),
                        // ),
                        new Positioned(
                          bottom: 15,
                          left: 0.0,
                          right: 0.0,
                          child: new Wisdom(
                            borderRadius: BorderRadius.circular(25.pt),
                            color: colorScheme.primary,
                            margin: EdgeInsets.symmetric(horizontal: 15.pt),
                            child: new TextButton(
                              child: new Text(
                                '提交评论',
                                textAlign: TextAlign.center,
                                style: new TextStyle(
                                    color: Colors.white, fontSize: 15.0),
                              ),
                              onPressed: () {
                                store.onSubmitComment();
                              },
                            ),
                          ),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          );
        },
      );
    }

    /// 异常列表弹窗
    void _onShowAbnormalList() {
      showModalBottomSheet(
        isScrollControlled: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(10.pt),
            topRight: Radius.circular(10.pt),
          ),
        ),
        context: context,
        builder: (BuildContext context) {
          return new SingleChildScrollView(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: SafeArea(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerLeft,
                      ),
                      Text(
                        '异常处理',
                        textAlign: TextAlign.center,
                        maxLines: 1,
                        style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 16,
                        ),
                      ).asExpanded(),
                      Wisdom(
                        width: 100,
                        alignment: Alignment.centerRight,
                        child: CloseButton(
                          onPressed: () => Navigator.pop(context),
                        ),
                      ),
                    ],
                  ),
                  Divider(height: 1),
                  ConstrainedBox(
                    constraints: BoxConstraints(minHeight: 200),
                    child: Stack(
                      children: [
                        Wisdom.column(
                          padding: EdgeInsets.symmetric(
                              horizontal: 15.pt, vertical: 10.pt),
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            for (int i = 0;
                                i < store.needDealAbnormalList.length;
                                i++)
                              Wisdom.row(
                                onTap: () => store.toTaskPointFormByAbnormal(
                                    store.needDealAbnormalList[i]),
                                padding: EdgeInsets.symmetric(
                                    horizontal: 5.pt, vertical: 10.pt),
                                margin: EdgeInsets.symmetric(vertical: 5.pt),
                                borderRadius: BorderRadius.circular(8.pt),
                                color: Colors.grey[100],
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  WisText(
                                    '${store.needDealAbnormalList[i].relationName ?? '--'}',
                                    size: 16.pt,
                                    weight: FontWeight.bold,
                                    height: 1.8,
                                    maxLines: 1,
                                    overflow: TextOverflow.ellipsis,
                                  ).asExpanded(),
                                  Wisdom.row(
                                    children: [
                                      Text(
                                        '所属区域：',
                                        style: TextStyle(
                                          fontSize: 14.pt,
                                        ),
                                      ),
                                      Text(
                                        '${store.needDealAbnormalList[i].nodeData['communityAreaName'] ?? '--'}',
                                        style: TextStyle(
                                          fontSize: 14.pt,
                                        ),
                                      ),
                                      Wisdom(
                                        margin: EdgeInsets.only(left: 5.pt),
                                        child: Icon(
                                          Icons.arrow_forward_ios,
                                          size: 14.pt,
                                          color: colorScheme.grey,
                                        ),
                                      )
                                    ],
                                  ),
                                ],
                              )
                          ],
                        ),
                        new Positioned(
                          bottom: 15,
                          left: 0.0,
                          right: 0.0,
                          child: new Wisdom(
                            borderRadius: BorderRadius.circular(25.pt),
                            color: colorScheme.primary,
                            margin: EdgeInsets.symmetric(horizontal: 15.pt),
                            child: new TextButton(
                              child: new Text(
                                '取消',
                                textAlign: TextAlign.center,
                                style: new TextStyle(
                                    color: Colors.white, fontSize: 15.0),
                              ),
                              onPressed: () => Navigator.pop(context),
                            ),
                          ),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          );
        },
      );
    }

    ///2020.07.09 修复无任何操作按钮时底部显示孤零零白条
    if (isCancel ||
        (!showEdit &&
            !showComment &&
            !showStart &&
            !showFinish &&
            !showPickup &&
            !showDealAbnormal)) {
      return Container(
        height: 0,
      );
    }
    return BottomAppBar(
      color: Colors.white,
      padding: EdgeInsets.all(0),
      child: Observer(builder: (_) {
        return DefaultTextStyle(
          style: TextStyle(
            color: colorScheme.primary,
          ),
          child: store.entryType == 'default'
              ? Wisdom.row(
                  color: Colors.white,
                  crossAxisAlignment: CrossAxisAlignment.stretch,
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  borderRadius: BorderRadius.only(
                    topRight: Radius.circular(12.pt),
                    topLeft: Radius.circular(12.pt),
                  ),
                  // paddi: EdgeInsets.only(bottom: 10.pt),
                  //  padding: EdgeInsets.fromLTRB(15.pt, 15.pt, 15.pt, 30.pt),
                  // padding: EdgeInsets.only(
                  //   left: 15.pt,
                  //   right: 15.pt,
                  //   bottom: Platform.isAndroid ? 0 : 15.pt,
                  // ),
                  children: <Widget>[
                    if (showShift)
                      Wisdom.column(
                        // width: 60.pt,
                        onTap: () => store.route2assigner(),
                        alignment: Alignment.center,
                        mainAxisAlignment: MainAxisAlignment.center,
                        padding: EdgeInsets.symmetric(horizontal: 15.pt),
                        children: <Widget>[
                          Image(
                            image: AssetList.$zp_png_image,
                            height: 23.pt,
                          ),
                          Text('转派', style: TextStyle(fontSize: 10.pt)),
                        ],
                      ),
                    if (showComment)
                      Wisdom.column(
                        // width: 60.pt,
                        onTap: () => _onShowComments(),
                        alignment: Alignment.center,
                        mainAxisAlignment: MainAxisAlignment.center,
                        padding: EdgeInsets.symmetric(horizontal: 15.pt),
                        children: <Widget>[
                          Image(
                            image: AssetList.$pl_png_image,
                            height: 25.pt,
                          ),
                          Text('评论', style: TextStyle(fontSize: 10.pt)),
                        ],
                      ),
                    if (showChild)
                      Wisdom.column(
                        // width: 60.pt,
                        onTap: () => store.toAddChild(),
                        alignment: Alignment.center,
                        mainAxisAlignment: MainAxisAlignment.center,
                        padding: EdgeInsets.symmetric(horizontal: 15.pt),
                        children: <Widget>[
                          Image(
                            image: AssetList.$zrw_png_image,
                            height: 25.pt,
                          ),
                          Text('子任务', style: TextStyle(fontSize: 10.pt)),
                        ],
                      ),
                    if (showStart)
                      Wisdom.column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        crossAxisAlignment: CrossAxisAlignment.stretch,
                        minWidth: 180.pt,
                        margin: EdgeInsets.only(right: 15.pt),
                        children: [
                          Container(
                            height: 44.pt,
                            decoration: BoxDecoration(
                              gradient: LinearGradient(
                                colors: [
                                  Color.fromRGBO(77, 128, 255, 1),
                                  Color.fromRGBO(15, 103, 248, 1)
                                ],
                                begin: Alignment.centerLeft,
                                end: Alignment.centerRight,
                              ),
                              borderRadius: BorderRadius.circular(25.pt),
                            ),
                            child: Wisdom(
                              onTap: () => store.onStartTask(),
                              child: Center(
                                  child: Text(
                                '开始任务',
                                style: TextStyle(
                                    fontSize: 14.pt, color: Colors.white),
                              )),
                            ),
                          ),
                        ],
                      ).asExpanded(),
                    if (showFinish)
                      Wisdom.column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        minWidth: 180.pt,
                        margin: EdgeInsets.only(right: 15.pt),
                        children: [
                          Container(
                              height: 44.pt,
                              decoration: BoxDecoration(
                                gradient: LinearGradient(
                                  colors: [
                                    Color.fromRGBO(77, 128, 255, 1),
                                    Color.fromRGBO(15, 103, 248, 1)
                                  ],
                                  begin: Alignment.centerLeft,
                                  end: Alignment.centerRight,
                                ),
                                borderRadius: BorderRadius.circular(25.pt),
                              ),
                              child: Wisdom(
                                onTap: () => store.onFinishTap(),
                                child: Center(
                                    child: Text(
                                  '完成任务',
                                  style: TextStyle(
                                    fontSize: 14.pt,
                                    color: Colors.white,
                                  ),
                                )),
                              ))
                        ],
                      ).asExpanded(),
                    if (showReopen)
                      Wisdom.column(
                        onTap: () => _onShowReopen(),
                        // width: 100.pt,
                        mainAxisAlignment: MainAxisAlignment.center,
                        alignment: Alignment.center,
                        padding: EdgeInsets.symmetric(horizontal: 15.pt),
                        children: [
                          Image(
                            image: AssetList.$reopen_png_image,
                            height: 23.pt,
                          ),
                          Wisdom(
                            child: Text(
                              '重新开启',
                              style: TextStyle(
                                fontSize: 10.pt,
                                color: colorScheme.primary,
                              ),
                            ),
                          )
                        ],
                      ),
                    if (showCheck)
                      Wisdom.column(
                        onTap: () => _onShowCheck(),
                        minWidth: 100.pt,
                        mainAxisAlignment: MainAxisAlignment.center,
                        alignment: Alignment.center,
                        children: [
                          Container(
                            height: 44.pt,
                            margin: EdgeInsets.only(right: 15.pt),
                            decoration: BoxDecoration(
                              gradient: LinearGradient(
                                colors: [
                                  Color.fromRGBO(77, 128, 255, 1),
                                  Color.fromRGBO(15, 103, 248, 1)
                                ],
                                begin: Alignment.centerLeft,
                                end: Alignment.centerRight,
                              ),
                              borderRadius: BorderRadius.circular(25.pt),
                            ),
                            child: Center(
                              child: Text(
                                '开始审查',
                                style: TextStyle(
                                  fontSize: 14.pt,
                                  color: Colors.white,
                                ),
                              ),
                            ),
                          )
                        ],
                      ).asExpanded(),
                    if (showCancel)
                      Wisdom.column(
                        width: 100.pt,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Wisdom(
                            height: 44.pt,
                            color: colorScheme.danger,
                            borderRadius: BorderRadius.circular(25.pt),
                            margin: EdgeInsets.only(right: 15.pt),
                            onTap: () => store.onDelete(),
                            child: Center(
                              child: Text(
                                '删除',
                                style: TextStyle(
                                    fontSize: 14.pt, color: Colors.white),
                              ),
                            ),
                          )
                        ],
                      ).asExpanded(),
                    if (showDealAbnormal == true &&
                        store.needDealAbnormalList.length > 0)
                      Wisdom.column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        crossAxisAlignment: CrossAxisAlignment.stretch,
                        minWidth: 180.pt,
                        margin: EdgeInsets.only(right: 15.pt),
                        children: [
                          Container(
                            height: 44.pt,
                            decoration: BoxDecoration(
                              gradient: LinearGradient(
                                colors: [
                                  Color.fromRGBO(77, 128, 255, 1),
                                  Color.fromRGBO(15, 103, 248, 1)
                                ],
                                begin: Alignment.centerLeft,
                                end: Alignment.centerRight,
                              ),
                              borderRadius: BorderRadius.circular(25.pt),
                            ),
                            child: Wisdom(
                              onTap: () => _onShowAbnormalList(),
                              child: Center(
                                  child: Text(
                                '异常处理',
                                style: TextStyle(
                                    fontSize: 14.pt, color: Colors.white),
                              )),
                            ),
                          ),
                        ],
                      ).asExpanded(),
                  ],
                )
              : store.entryType == 'pickUp'
                  ? Wisdom.row(
                      color: Colors.white,
                      height: 44.pt,
                      mainAxisAlignment: MainAxisAlignment.center,
                      padding: EdgeInsets.only(
                          left: 15.pt, right: 15.pt, bottom: 10.pt),
                      onTap: () => {
                            /// 以下逻辑作废 直接领取
                            /// 1.是否超时任务
                            /// 2.是否按序任务，是否在当前序号位置点
                            /// 3.两者同时
                            ///
                            _DialogComponent.show(
                                context, '是否领取此任务？', data?.id),
                          },
                      children: [
                          Wisdom(
                            height: 44.pt,
                            color: colorScheme.primary,
                            borderRadius: BorderRadius.circular(25.pt),
                            child: Center(
                              child: WisText(
                                '领取任务',
                                size: 16.pt,
                                color: Colors.white,
                              ),
                            ),
                          ).asExpanded(),
                        ])
                  : Container(height: 0),
        );
      }),
    );
  }
}

class _DialogComponent extends StatefulWidget {
  _DialogComponent({
    Key? key,
    this.title,
    this.id,
  }) : super(key: key);
  final String? title;
  final String? id;
  static show(BuildContext context, title, id) async {
    await showDialog(
      barrierDismissible: false,
      context: context,
      builder: (context) {
        return _DialogComponent(
          title: title,
          id: id,
        );
      },
    );
  }

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

class __DialogComponentState extends State<_DialogComponent> {
  final formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    final colorScheme = WTheme.of(context).colorScheme;

    return Provider<PrivateTaskDetailStore>(
        create: (_) => PrivateTaskDetailStore(context),
        child: WisDialog(
          title: Wisdom.row(
            mainAxisAlignment: MainAxisAlignment.center,
            padding: EdgeInsets.symmetric(vertical: 20.pt),
            children: [
              WisText(
                '领取提醒',
                size: 18.pt,
                weight: FontWeight.w600,
                color: colorScheme.mainTitle,
              )
            ],
          ),
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(20.pt),
          ),
          titlePadding: EdgeInsets.all(0),
          isHasClose: false,
          contentPadding: EdgeInsets.all(0),
          insetPadding: EdgeInsets.all(0),
          content: Container(
            width: (MediaQuery.of(context).size.width - 68.pt),
            height: 125.pt,
            child: Wisdom.column(children: [
              Wisdom(
                margin: EdgeInsets.only(bottom: 30.pt),
                child: WisText(
                  '${widget.title}',
                  size: 16.pt,
                  color: colorScheme.minor,
                ),
              ),
              Wisdom.row(
                padding: EdgeInsets.symmetric(horizontal: 20.pt),
                children: [
                  WLoadingButton(
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(24.5.pt),
                    ),
                    margin: EdgeInsets.only(right: 7.5.pt),
                    onPressed: () async {
                      /// 取消关闭弹窗
                      Navigator.pop(context);
                    },
                    color: colorScheme.background,
                    height: 44.pt,
                    child: Text('取消'),
                  ).asExpanded(),
                  WLoadingButton(
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(24.5.pt),
                    ),
                    margin: EdgeInsets.only(left: 7.5.pt),
                    onPressed: () => PrivateTaskDetailStore(context)
                        .onHandlePickup(widget.id),
                    color: colorScheme.primary,
                    height: 44.pt,
                    child: Text('确认'),
                  ).asExpanded(),
                ],
              )
            ]),
          ),
        ));
  }
}
