瀏覽代碼

Minor refactoring

Neeraj Gupta 2 年之前
父節點
當前提交
bfe09f5436
共有 2 個文件被更改,包括 1 次插入9 次删除
  1. 0 4
      lib/ui/components/button_widget.dart
  2. 1 5
      lib/ui/viewer/actions/delete_empty_albums.dart

+ 0 - 4
lib/ui/components/button_widget.dart

@@ -372,10 +372,6 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
   bool get _shouldRegisterGestures =>
   bool get _shouldRegisterGestures =>
       !widget.isDisabled && executionState == ExecutionState.idle;
       !widget.isDisabled && executionState == ExecutionState.idle;
 
 
-  void onTapExternal() async {
-    return _onTap();
-  }
-
   void _onTap() async {
   void _onTap() async {
     if (widget.onTap != null) {
     if (widget.onTap != null) {
       _debouncer.run(
       _debouncer.run(

+ 1 - 5
lib/ui/viewer/actions/delete_empty_albums.dart

@@ -1,4 +1,3 @@
-import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/collection_updated_event.dart';
 import 'package:photos/events/collection_updated_event.dart';
@@ -78,7 +77,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
     );
     );
   }
   }
 
 
-  Future<bool> _deleteEmptyAlbums() async {
+  Future<void> _deleteEmptyAlbums() async {
     final collections =
     final collections =
         await CollectionsService.instance.getCollectionsWithThumbnails();
         await CollectionsService.instance.getCollectionsWithThumbnails();
     collections.removeWhere((element) => element.thumbnail != null);
     collections.removeWhere((element) => element.thumbnail != null);
@@ -94,13 +93,10 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
         } catch (_) {
         } catch (_) {
           failedCount++;
           failedCount++;
         }
         }
-      } else {
-        return false;
       }
       }
     }
     }
     if (failedCount > 0) {
     if (failedCount > 0) {
       debugPrint("Delete ops failed for $failedCount collections");
       debugPrint("Delete ops failed for $failedCount collections");
     }
     }
-    return true;
   }
   }
 }
 }