diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 4738f617..2f2a538f 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -96,6 +96,10 @@ } } }, + "share": "Share", + "@share": { + "description": "asking user if to share" + }, "shareYoutubeLink": "Share YouTube link", "@shareYoutubeLink": { "description": "asking user to share youtube link" diff --git a/lib/videos/states/add_to_playlist.dart b/lib/videos/states/add_to_playlist.dart index b427f163..6b037900 100644 --- a/lib/videos/states/add_to_playlist.dart +++ b/lib/videos/states/add_to_playlist.dart @@ -43,6 +43,8 @@ class AddToPlaylistCubit extends Cubit { late List playlists; if (state.isLoggedIn) { playlists = await service.getUserPlaylists(); + } else { + playlists = List.empty(); } emit(state.copyWith(playlists: playlists, loading: false)); } diff --git a/lib/videos/views/components/video_modal_sheet.dart b/lib/videos/views/components/video_modal_sheet.dart index c9ce9925..01f362ff 100644 --- a/lib/videos/views/components/video_modal_sheet.dart +++ b/lib/videos/views/components/video_modal_sheet.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:invidious/player/states/player.dart'; +import 'package:invidious/utils.dart'; import 'package:invidious/videos/models/base_video.dart'; import 'package:invidious/videos/views/components/add_to_playlist_button.dart'; import 'package:invidious/videos/views/components/download_modal_sheet.dart'; @@ -56,6 +57,11 @@ class VideoModalSheet extends StatelessWidget { DownloadModalSheet.showVideoModalSheet(context, video); } + void _showSharingSheet(BuildContext context) { + Navigator.of(context).pop(); + showSharingSheet(context, video); + } + @override Widget build(BuildContext context) { var locals = AppLocalizations.of(context)!; @@ -110,6 +116,20 @@ class VideoModalSheet extends StatelessWidget { ], ), ), + Padding( + padding: getDeviceType() == DeviceType.phone + ? const EdgeInsets.only(top: 8.0) + : const EdgeInsets.only(right: 16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton.filledTonal( + onPressed: () => _showSharingSheet(context), + icon: const Icon(Icons.share)), + Text(locals.share) + ], + ), + ), ], ), ), diff --git a/submodules/flutter b/submodules/flutter index ef1af02a..db7ef5bf 160000 --- a/submodules/flutter +++ b/submodules/flutter @@ -1 +1 @@ -Subproject commit ef1af02aead6fe2414f3aafa5a61087b610e1332 +Subproject commit db7ef5bf9f59442b0e200a90587e8fa5e0c6336a