Add share button to selection actions

This commit is contained in:
ashilkn 2023-08-09 17:49:01 +05:30
parent 344fce0a02
commit 8c315cc933
2 changed files with 14 additions and 1 deletions

View file

@ -25,6 +25,7 @@ import "package:photos/ui/tools/collage/collage_creator_page.dart";
import 'package:photos/utils/delete_file_util.dart';
import 'package:photos/utils/magic_util.dart';
import 'package:photos/utils/navigation_util.dart';
import "package:photos/utils/share_util.dart";
import 'package:photos/utils/toast_util.dart';
class FileSelectionActionsWidget extends StatefulWidget {
@ -57,6 +58,7 @@ class _FileSelectionActionsWidgetState
// links if user keeps on creating Create link button after selecting
// few files. This link is reset on any selection changed;
Collection? _cachedCollectionForSharedLink;
final GlobalKey shareButtonKey = GlobalKey();
@override
void initState() {
@ -269,6 +271,18 @@ class _FileSelectionActionsWidgetState
);
}
items.add(
SelectionActionButton(
labelText: "Share",
icon: Icons.adaptive.share_outlined,
onTap: () => shareSelected(
context,
shareButtonKey,
widget.selectedFiles.files.toList(),
),
),
);
if (items.isNotEmpty) {
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),

View file

@ -24,7 +24,6 @@ class FileSelectionOverlayBar extends StatefulWidget {
}
class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
final GlobalKey shareButtonKey = GlobalKey();
final ValueNotifier<bool> _hasSelectedFilesNotifier = ValueNotifier(false);
@override