Procházet zdrojové kódy

[archive] add popup option for archive on home page

Neeraj Gupta před 3 roky
rodič
revize
0173b3974c
1 změnil soubory, kde provedl 31 přidání a 0 odebrání
  1. 31 0
      lib/ui/gallery_app_bar_widget.dart

+ 31 - 0
lib/ui/gallery_app_bar_widget.dart

@@ -1,5 +1,6 @@
 import 'dart:async';
 import 'dart:io';
+
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:logging/logging.dart';
@@ -235,6 +236,36 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
         ));
       }
     }
+
+    if (widget.type == GalleryAppBarType.homepage) {
+      actions.add(PopupMenuButton(
+        itemBuilder: (context) {
+          final List<PopupMenuItem> items = [];
+          items.add(
+            PopupMenuItem(
+              value: 1,
+              child: Row(
+                children: [
+                  Icon(Platform.isAndroid
+                      ? Icons.archive_outlined
+                      : CupertinoIcons.archivebox),
+                  Padding(
+                    padding: EdgeInsets.all(8),
+                  ),
+                  Text("archive"),
+                ],
+              ),
+            ),
+          );
+          return items;
+        },
+        onSelected: (value) {
+          if (value == 1) {
+            showToast("coming soon");
+          }
+        },
+      ));
+    }
     return actions;
   }