Skip to content

Commit

Permalink
add share button to video modal sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Outlet7493 committed Jan 14, 2024
1 parent 3b5fca9 commit 02743f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions lib/videos/views/components/video_modal_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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)!;
Expand Down Expand Up @@ -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)
],
),
),
],
),
),
Expand Down

0 comments on commit 02743f2

Please sign in to comment.