Bladeren bron

Added animation and handled error for reset ignored files

ashilkn 2 jaren geleden
bovenliggende
commit
c7f0cce5dc
1 gewijzigde bestanden met toevoegingen van 12 en 2 verwijderingen
  1. 12 2
      lib/ui/viewer/gallery/device_folder_page.dart

+ 12 - 2
lib/ui/viewer/gallery/device_folder_page.dart

@@ -132,8 +132,9 @@ class BackupHeaderWidget extends StatelessWidget {
               FutureBuilder(
                 future: _hasIgnoredFiles(filesInDeviceCollection),
                 builder: (context, snapshot) {
+                  Widget child;
                   if (snapshot.hasData && snapshot.data as bool) {
-                    return Column(
+                    child = Column(
                       children: [
                         const SizedBox(height: 24),
                         MenuItemWidget(
@@ -156,9 +157,18 @@ class BackupHeaderWidget extends StatelessWidget {
                         ),
                       ],
                     );
+                  } else if (snapshot.hasError) {
+                    Logger("BackupHeaderWidget").severe(
+                      "Could not check if collection has ignored files",
+                    );
+                    child = const SizedBox.shrink();
                   } else {
-                    return const SizedBox.shrink();
+                    child = const SizedBox.shrink();
                   }
+                  return AnimatedSwitcher(
+                    duration: const Duration(milliseconds: 48),
+                    child: child,
+                  );
                 },
               )
             ],