Skip to content

Commit

Permalink
✨ Display post delete confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlphamerc committed Jun 4, 2021
1 parent ebb21c4 commit 4ef4368
Showing 1 changed file with 77 additions and 59 deletions.
136 changes: 77 additions & 59 deletions lib/widgets/tweet/widgets/tweetBottomSheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,35 +116,44 @@ class TweetBottomSheet {
text: 'Delete Tweet',
onPressed: () {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text("Delete"),
content: Text('Do you want to delete this Tweet?'),
actions: [
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
Navigator.pop(context);
},
child: Text('NO'),
),
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
_deleteTweet(
context,
type,
model.key,
parentkey: model.parentkey,
);
},
child: Text('YES'),
),
],
),
);
context: context,
builder: (_) => AlertDialog(
title: Text("Delete"),
content: Text('Do you want to delete this Tweet?'),
actions: [
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
Navigator.pop(context);
Navigator.pop(context);
},
child: Text('Cancel'),
),
// ignore: deprecated_member_use
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
TwitterColor.dodgetBlue,
),
foregroundColor: MaterialStateProperty.all(
TwitterColor.white,
),
),
onPressed: () {
Navigator.pop(context);
_deleteTweet(
context,
type,
model.key,
parentkey: model.parentkey,
);
},
child: Text('Confirm'),
),
],
),
);
},
isEnable: true,
)
Expand Down Expand Up @@ -237,36 +246,45 @@ class TweetBottomSheet {
AppIcon.delete,
text: 'Delete Tweet',
onPressed: () {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text("Delete"),
content: Text('Do you want to delete this Tweet?'),
actions: [
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
Navigator.pop(context);
},
child: Text('NO'),
),
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
_deleteTweet(
context,
type,
model.key,
parentkey: model.parentkey,
);
},
child: Text('YES'),
),
],
),
);
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text("Delete"),
content: Text('Do you want to delete this Tweet?'),
actions: [
// ignore: deprecated_member_use
FlatButton(
textColor: Colors.black,
onPressed: () {
Navigator.pop(context);
Navigator.pop(context);
},
child: Text('Cancel'),
),
// ignore: deprecated_member_use
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
TwitterColor.dodgetBlue,
),
foregroundColor: MaterialStateProperty.all(
TwitterColor.white,
),
),
onPressed: () {
Navigator.pop(context);
_deleteTweet(
context,
type,
model.key,
parentkey: model.parentkey,
);
},
child: Text('Confirm'),
),
],
),
);
},
isEnable: true,
)
Expand Down

0 comments on commit 4ef4368

Please sign in to comment.