Parcourir la source

Add sharing option for local folders within app bar

Vishnu Mohandas il y a 4 ans
Parent
commit
88c09ace89
1 fichiers modifiés avec 21 ajouts et 12 suppressions
  1. 21 12
      lib/ui/gallery_app_bar_widget.dart

+ 21 - 12
lib/ui/gallery_app_bar_widget.dart

@@ -87,18 +87,27 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
   List<Widget> _getDefaultActions(BuildContext context) {
     List<Widget> actions = List<Widget>();
     if (Configuration.instance.hasConfiguredAccount()) {
-      actions.add(IconButton(
-        icon: Icon(Icons.settings),
-        onPressed: () {
-          Navigator.of(context).push(
-            MaterialPageRoute(
-              builder: (BuildContext context) {
-                return SettingsPage();
-              },
-            ),
-          );
-        },
-      ));
+      if (widget.type == GalleryAppBarType.homepage) {
+        actions.add(IconButton(
+          icon: Icon(Icons.settings),
+          onPressed: () {
+            Navigator.of(context).push(
+              MaterialPageRoute(
+                builder: (BuildContext context) {
+                  return SettingsPage();
+                },
+              ),
+            );
+          },
+        ));
+      } else if (widget.type == GalleryAppBarType.local_folder) {
+        actions.add(IconButton(
+          icon: Icon(Icons.share),
+          onPressed: () {
+            _showShareCollectionDialog();
+          },
+        ));
+      }
     } else {
       actions.add(IconButton(
         icon: Icon(Icons.sync_disabled),