NullSafety: Migrate DeduplicateFiles model

This commit is contained in:
Neeraj Gupta 2022-12-30 13:53:32 +05:30
parent c6dbe06d48
commit 801707bbb9
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -1,5 +1,3 @@
// @dart=2.9
import 'dart:convert';
import 'package:photos/models/file.dart';
@ -58,9 +56,10 @@ class DuplicateFiles {
sortByCollectionName() {
files.sort((first, second) {
final firstName =
collectionsService.getCollectionByID(first.collectionID).name;
collectionsService.getCollectionByID(first.collectionID!)!.name ?? '';
final secondName =
collectionsService.getCollectionByID(second.collectionID).name;
collectionsService.getCollectionByID(second.collectionID!)!.name ??
'';
return firstName.compareTo(secondName);
});
}