Skip to content

Commit

Permalink
feat: group delete confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnfire05 committed Nov 27, 2024
1 parent a0e8506 commit 158df91
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 39 deletions.
2 changes: 2 additions & 0 deletions assets/i18n/strings.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"manage": {
"header": "Group Management",
"back": "Back",
"deleteConfirmationTitle": "Are you sure you want to delete the group?",
"deleteConfirmationMessage": "This will not affect the notices previously posted under this group name.",
"change": "Change",
"profileImage": "Change Group Profile Image",
"name": {
Expand Down
2 changes: 2 additions & 0 deletions assets/i18n/strings_jp.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"manage": {
"header": "グループ管理",
"back": "戻る",
"deleteConfirmationTitle": "グループを削除してもよろしいですか?",
"deleteConfirmationMessage": "このグループ名で投稿された以前の通知には影響しません。",
"change": "変更",
"profileImage": "グループのプロフィール写真を変更",
"name": {
Expand Down
2 changes: 2 additions & 0 deletions assets/i18n/strings_ko.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"manage": {
"header": "그룹 관리",
"back": "돌아가기",
"deleteConfirmationTitle": "정말 그룹을 삭제하시겠습니까?",
"deleteConfirmationMessage": "기존에 본 그룹 명의로 작성된 공지에는 영향을 끼치지 않습니다.",
"change": "변경",
"profileImage": "그룹 프로필 사진 변경",
"name": {
Expand Down
2 changes: 2 additions & 0 deletions assets/i18n/strings_ru.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"manage": {
"header": "Управление группами",
"back": "Назад",
"deleteConfirmationTitle": "Вы уверены, что хотите удалить группу?",
"deleteConfirmationMessage": "Это не повлияет на ранее опубликованные уведомления под этим именем группы.",
"change": "изменение",
"profileImage": "Изменить изображение профиля группы",
"name": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ziggle/app/di/locator.dart';
Expand Down Expand Up @@ -130,47 +131,48 @@ class GroupManagementPage extends StatelessWidget {
BlocBuilder<GroupManagementBloc, GroupManagementState>(
builder: (context, state) {
return ZiggleRowButton(
title: Text(
context.t.group.manage.delete,
style: TextStyle(
color: Palette.primary,
),
title: Text(
context.t.group.manage.delete,
style: TextStyle(
color: Palette.primary,
),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext dialogContext) {
return AlertDialog(
title: Text('제목'),
content: Text('내용'),
// title: Text(context
// .t.group.manage.deleteConfirmationTitle),
// content: Text(context.t.group.manage
// .deleteConfirmationMessage),
actions: [
TextButton(
child: Text(context.t.common.cancel),
onPressed: () {
Navigator.of(dialogContext)
.pop(); // Dismiss the dialog
},
),
TextButton(
child: Text('ok'),
// child: Text(context.t.common.ok),
onPressed: () {
Navigator.of(dialogContext)
.pop(); // Dismiss the dialog
context.read<GroupManagementBloc>().add(
GroupManagementEvent.delete(
group!.uuid),
);
},
),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext dialogContext) {
return CupertinoAlertDialog(
title: Text(context
.t.group.manage.deleteConfirmationTitle),
content: Text(context
.t.group.manage.deleteConfirmationMessage),
actions: [
CupertinoDialogAction(
isDestructiveAction: true,
child: Text(context.t.common.confirm),
onPressed: () {
Navigator.of(dialogContext).pop();
context.read<GroupManagementBloc>().add(
GroupManagementEvent.delete(
group!.uuid),
);
},
),
CupertinoDialogAction(
child: Text(
context.t.common.cancel,
style: TextStyle(
color: Palette.grayText,
),
),
],
);
});
});
onPressed: () =>
Navigator.of(dialogContext).pop()),
],
);
},
);
},
);
},
),
const SizedBox(height: 20),
Expand Down

0 comments on commit 158df91

Please sign in to comment.