Skip to content

Commit f7032ec

Browse files
prateekmediaclaude
andcommitted
fix: resolve flutter analyze issues in hierarchical album picker
- Add missing localization strings (createNewAlbum, createNewSubAlbum, albumName, noAlbumsFound) - Fix unused imports and missing trailing commas - Fix null-aware operator usage on non-nullable types - Fix async function return type for onTap callback - Update all S.of(context) references to AppLocalizations.of(context) Co-Authored-By: Claude <[email protected]>
1 parent b0fe20a commit f7032ec

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

SUPPORT.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

mobile/apps/photos/lib/l10n/intl_en.arb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,5 +1941,9 @@
19411941
"closeBy": "Close",
19421942
"@closeBy": {
19431943
"description": "Appears in the similar images page, to indicate that the images are close in terms of appearance"
1944-
}
1944+
},
1945+
"createNewAlbum": "Create new album",
1946+
"createNewSubAlbum": "Create new sub-album",
1947+
"albumName": "Album name",
1948+
"noAlbumsFound": "No albums found"
19451949
}

mobile/apps/photos/lib/ui/collections/hierarchical_album_picker.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import 'package:flutter/material.dart';
22
import 'package:photos/core/configuration.dart';
33
import 'package:photos/generated/l10n.dart';
44
import 'package:photos/models/collection/collection.dart';
5-
import 'package:photos/models/collection/collection_items.dart';
65
import 'package:photos/service_locator.dart';
76
import 'package:photos/services/collections_service.dart';
87
import 'package:photos/theme/ente_theme.dart';
9-
import 'package:photos/ui/collections/collection_item_widget.dart';
108
import 'package:photos/ui/components/buttons/button_widget.dart';
119
import 'package:photos/ui/components/models/button_type.dart';
1210

@@ -72,7 +70,7 @@ class _HierarchicalAlbumPickerState extends State<HierarchicalAlbumPicker> {
7270
// Apply additional filters
7371
if (widget.showOnlyOwnedAlbums) {
7472
_allCollections = _allCollections
75-
.where((c) => c.owner?.id == userId)
73+
.where((c) => c.owner.id == userId)
7674
.toList();
7775
}
7876

@@ -87,11 +85,11 @@ class _HierarchicalAlbumPickerState extends State<HierarchicalAlbumPicker> {
8785
_allCollections = _allCollections
8886
.where((c) => c.type != CollectionType.favorites &&
8987
c.type != CollectionType.uncategorized &&
90-
!c.isDefaultHidden())
88+
!c.isDefaultHidden(),)
9189
.toList();
9290

9391
// Sort by name
94-
_allCollections.sort((a, b) => a.displayName.compareTo(b.displayName));
92+
_allCollections.sort((a, b) => a.displayName.compareTo(b.displayName),);
9593

9694
// Update current level collections
9795
_updateCurrentLevelCollections();
@@ -103,7 +101,7 @@ class _HierarchicalAlbumPickerState extends State<HierarchicalAlbumPicker> {
103101
_currentLevelCollections = _allCollections
104102
.where((c) => c.displayName
105103
.toLowerCase()
106-
.contains(widget.searchQuery!.toLowerCase()))
104+
.contains(widget.searchQuery!.toLowerCase()),)
107105
.toList();
108106
} else {
109107
// Show hierarchical view
@@ -330,7 +328,7 @@ class _HierarchicalAlbumPickerState extends State<HierarchicalAlbumPicker> {
330328
if (_currentLocation != null) {
331329
// Create sub-album
332330
newCollection = await CollectionsService.instance
333-
.createSubAlbum(_currentLocation!, albumName);
331+
.createSubAlbum(albumName, _currentLocation!);
334332
} else {
335333
// Create root album
336334
newCollection = await CollectionsService.instance
@@ -495,7 +493,7 @@ class _HierarchicalAlbumPickerState extends State<HierarchicalAlbumPicker> {
495493
labelText: widget.actionButtonText ??
496494
AppLocalizations.of(context).add,
497495
isDisabled: _selectedCollections.isEmpty,
498-
onTap: () {
496+
onTap: () async {
499497
widget.onMultipleAlbumsSelected?.call(
500498
_selectedCollections.toList(),
501499
);

0 commit comments

Comments
 (0)