Преглед изворни кода

Override galleryType for uncategorized collection

Neeraj Gupta пре 2 година
родитељ
комит
eb048b57b4
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      lib/ui/viewer/gallery/collection_page.dart

+ 5 - 2
lib/ui/viewer/gallery/collection_page.dart

@@ -3,6 +3,7 @@ import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/collection_updated_event.dart';
 import 'package:photos/events/collection_updated_event.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/events/files_updated_event.dart';
+import 'package:photos/models/collection.dart';
 import 'package:photos/models/collection_items.dart';
 import 'package:photos/models/collection_items.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file_load_result.dart';
 import 'package:photos/models/file_load_result.dart';
@@ -55,6 +56,8 @@ class _CollectionPageState extends State<CollectionPage> {
     if (widget.hasVerifiedLock == false && widget.c.collection.isHidden()) {
     if (widget.hasVerifiedLock == false && widget.c.collection.isHidden()) {
       return const EmptyState();
       return const EmptyState();
     }
     }
+    final appBarTypeValue = widget.c.collection.type == CollectionType
+        .uncategorized ? GalleryType.uncategorized : widget.appBarType;
     final List<File>? initialFiles =
     final List<File>? initialFiles =
         widget.c.thumbnail != null ? [widget.c.thumbnail!] : null;
         widget.c.thumbnail != null ? [widget.c.thumbnail!] : null;
     final gallery = Gallery(
     final gallery = Gallery(
@@ -93,7 +96,7 @@ class _CollectionPageState extends State<CollectionPage> {
       appBar: PreferredSize(
       appBar: PreferredSize(
         preferredSize: const Size.fromHeight(50.0),
         preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
         child: GalleryAppBarWidget(
-          widget.appBarType,
+          appBarTypeValue,
           widget.c.collection.name,
           widget.c.collection.name,
           _selectedFiles,
           _selectedFiles,
           collection: widget.c.collection,
           collection: widget.c.collection,
@@ -104,7 +107,7 @@ class _CollectionPageState extends State<CollectionPage> {
         children: [
         children: [
           gallery,
           gallery,
           FileSelectionOverlayBar(
           FileSelectionOverlayBar(
-            widget.appBarType,
+            appBarTypeValue,
             _selectedFiles,
             _selectedFiles,
             collection: widget.c.collection,
             collection: widget.c.collection,
           )
           )