Skip to content

Commit

Permalink
chore(yt): confirm before removing video like
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Jul 13, 2024
1 parent c746c82 commit a09eff8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions lib/youtube/youtube_miniplayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ class YoutubeMiniPlayerState extends State<YoutubeMiniPlayer> {
super.dispose();
}

Future<bool> _confirmRemoveLike() async {
bool confirmed = false;
await NamidaNavigator.inst.navigateDialog(
dialog: CustomBlurryDialog(
isWarning: true,
normalTitleStyle: true,
bodyText: lang.CONFIRM,
actions: [
const CancelButton(),
NamidaButton(
text: lang.REMOVE.toUpperCase(),
onPressed: () async {
NamidaNavigator.inst.closeDialog();
confirmed = true;
},
),
],
),
);
return confirmed;
}

@override
Widget build(BuildContext context) {
const space1sb = 8.0;
Expand Down Expand Up @@ -572,6 +594,10 @@ class YoutubeMiniPlayerState extends State<YoutubeMiniPlayer> {
disabledColor: context.theme.iconTheme.color,
size: 24.0,
onTap: (isLiked) async {
if (isLiked) {
final confirmed = await _confirmRemoveLike();
if (!confirmed) return isLiked;
}
return _onChangeLikeStatus(
page,
isLiked,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 3.2.0-beta+240712000
version: 3.2.1-beta+240713183

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit a09eff8

Please sign in to comment.