refactor: change delete chat snackbar

This commit is contained in:
Vick Top 2024-04-19 14:21:14 +02:00
parent 6bafc86a2d
commit e85b107038
2 changed files with 103 additions and 68 deletions

View file

@ -163,6 +163,8 @@ class _ChatScreenState extends State<ChatScreen> {
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
Text(
chat.canBeDeleted
@ -170,50 +172,80 @@ class _ChatScreenState extends State<ChatScreen> {
.deleteChatModalTitle
: translations
.chatCantBeDeleted,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 20,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 16),
const SizedBox(height: 24),
if (chat.canBeDeleted)
Text(
Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 16,
),
child: Text(
translations
.deleteChatModalDescription,
textAlign:
TextAlign.center,
style: const TextStyle(
fontSize: 16,
fontSize: 18,
),
),
const SizedBox(height: 16),
),
const SizedBox(
height: 24,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
TextButton(
child: Text(
translations
.deleteChatModalCancel,
style: const TextStyle(
fontSize: 16,
),
),
onPressed: () =>
Navigator.of(
context,
).pop(false),
),
if (chat.canBeDeleted)
ElevatedButton(
onPressed: () =>
Navigator.of(
context,
).pop(true),
).pop(false),
child: Text(
translations
.deleteChatModalCancel,
style: const TextStyle(
color: Colors.black,
fontSize: 18,
),
),
),
if (chat.canBeDeleted)
const SizedBox(
width: 16,
),
if (chat.canBeDeleted)
ElevatedButton(
style: ElevatedButton
.styleFrom(
backgroundColor:
const Color
.fromRGBO(
113,
198,
209,
1,
),
),
onPressed: () =>
Navigator.of(
context,
).pop(
true,
),
child: Text(
translations
.deleteChatModalConfirm,
style:
const TextStyle(
fontSize: 16,
color: Colors.white,
fontSize: 18,
),
),
),

View file

@ -154,7 +154,8 @@ return ListView.separated(
), // Add Divider here
itemBuilder: (context, index) {
var user = filteredUsers[index];
var isSelected = selectedUserList.any((selectedUser) => selectedUser == user);
var isSelected =
selectedUserList.any((selectedUser) => selectedUser == user);
return InkWell(
onTap: () {
@ -170,7 +171,8 @@ return ListView.separated(
child: Container(
color: isSelected ? Colors.amber.shade200 : Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 30),
padding:
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 30),
child: Row(
children: [
Padding(
@ -201,4 +203,5 @@ return ListView.separated(
);
},
);
}}
}
}