From d7b02d1f8c11ceb45c8ac0d8b2a92a426d877d1d Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 4 Feb 2021 15:50:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_views/widgets/chat_card.dart | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index 974c836c..d252d119 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/model/common/img_model.dart'; import 'package:akuCommunity/provider/user_provider.dart'; @@ -6,6 +7,7 @@ import 'package:akuCommunity/utils/headers.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -213,7 +215,30 @@ class _ChatCardState extends State { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, height: 48.w, - onPressed: () {}, + onPressed: () async { + bool result = + await Get.dialog(CupertinoAlertDialog( + title: '你确定删除吗'.text.isIntrinsic.make(), + actions: [ + CupertinoDialogAction( + child: '取消'.text.isIntrinsic.make(), + onPressed: () => Get.back(), + ), + CupertinoDialogAction( + child: '确定' + .text + .color(kPrimaryColor) + .isIntrinsic + .make(), + onPressed: () => Get.back(result: true), + ), + ], + )); + + if (result == true) { + //TODO delete operation + } + }, child: '删除'.text.black.size(28.sp).make(), ) : SizedBox(),