diff --git a/lib/events/clear_selections.dart b/lib/events/clear_selections_event.dart similarity index 50% rename from lib/events/clear_selections.dart rename to lib/events/clear_selections_event.dart index dd2a11de6..f35ee3749 100644 --- a/lib/events/clear_selections.dart +++ b/lib/events/clear_selections_event.dart @@ -1,3 +1,3 @@ import 'package:photos/events/event.dart'; -class ClearSelections extends Event {} +class ClearSelectionsEvent extends Event {} diff --git a/lib/models/selected_files.dart b/lib/models/selected_files.dart index 99ffea6ae..e2398b609 100644 --- a/lib/models/selected_files.dart +++ b/lib/models/selected_files.dart @@ -1,7 +1,7 @@ import 'package:collection/collection.dart' show IterableExtension; import 'package:flutter/foundation.dart'; -import 'package:flutter/rendering.dart'; import 'package:photos/core/event_bus.dart'; +import 'package:photos/events/clear_selections_event.dart'; import 'package:photos/models/file.dart'; class SelectedFiles extends ChangeNotifier { @@ -53,7 +53,7 @@ class SelectedFiles extends ChangeNotifier { } void clearAll() { - Bus.instance.fire(const ClearSelectionEvent()); + Bus.instance.fire(ClearSelectionsEvent()); lastSelections.addAll(files); files.clear(); notifyListeners(); diff --git a/lib/ui/huge_listview/lazy_loading_gallery.dart b/lib/ui/huge_listview/lazy_loading_gallery.dart index 42ebf1c73..e53ac7aab 100644 --- a/lib/ui/huge_listview/lazy_loading_gallery.dart +++ b/lib/ui/huge_listview/lazy_loading_gallery.dart @@ -10,6 +10,7 @@ import 'package:flutter/services.dart'; import 'package:logging/logging.dart'; import 'package:photos/core/constants.dart'; import 'package:photos/core/event_bus.dart'; +import 'package:photos/events/clear_selections_event.dart'; import 'package:photos/events/files_updated_event.dart'; import 'package:photos/models/file.dart'; import 'package:photos/models/selected_files.dart'; @@ -293,15 +294,15 @@ class LazyLoadingGridView extends StatefulWidget { class _LazyLoadingGridViewState extends State { bool _shouldRender; - StreamSubscription _clearSelectionEvent; + StreamSubscription _clearSelectionsEvent; @override void initState() { _shouldRender = widget.shouldRender; widget.shouldSelectAll.addListener(_shouldSelectAllListener); widget.selectedFiles.addListener(_selectedFilesListener); - _clearSelectionEvent = - Bus.instance.on().listen((event) { + _clearSelectionsEvent = + Bus.instance.on().listen((event) { if (mounted) { setState(() {}); } @@ -313,7 +314,7 @@ class _LazyLoadingGridViewState extends State { void dispose() { widget.selectedFiles.removeListener(_selectedFilesListener); widget.shouldSelectAll.removeListener(_shouldSelectAllListener); - _clearSelectionEvent.cancel(); + _clearSelectionsEvent.cancel(); super.dispose(); }