3
3
// in the LICENSE file.
4
4
5
5
import 'dart:io' ;
6
- import 'dart:typed_data' ;
6
+ import 'dart:typed_data' as typed_data ;
7
7
8
8
import 'package:flutter/foundation.dart' ;
9
9
import 'package:flutter/rendering.dart' ;
@@ -280,7 +280,12 @@ class AssetPathEntity {
280
280
281
281
@override
282
282
int get hashCode =>
283
- hashValues (id, name, albumType, type, lastModified, isAll);
283
+ id.hashCode ^
284
+ name.hashCode ^
285
+ albumType.hashCode ^
286
+ type.hashCode ^
287
+ lastModified.hashCode ^
288
+ isAll.hashCode;
284
289
285
290
@override
286
291
String toString () {
@@ -515,7 +520,7 @@ class AssetEntity {
515
520
///
516
521
/// **Use it with cautious** since the original data might be epic large.
517
522
/// Generally use this method only for images.
518
- Future <Uint8List ?> get originBytes => _getOriginBytes ();
523
+ Future <typed_data. Uint8List ?> get originBytes => _getOriginBytes ();
519
524
520
525
/// Obtain the thumbnail data with [PMConstants.vDefaultThumbnailSize]
521
526
/// size of the asset, typically use it for preview displays.
@@ -527,7 +532,7 @@ class AssetEntity {
527
532
/// See also:
528
533
/// * [thumbnailDataWithSize] which is a common method to obtain thumbnails.
529
534
/// * [thumbnailDataWithOption] which accepts customized [ThumbnailOption] .
530
- Future <Uint8List ?> get thumbnailData => thumbnailDataWithSize (
535
+ Future <typed_data. Uint8List ?> get thumbnailData => thumbnailDataWithSize (
531
536
const ThumbnailSize .square (PMConstants .vDefaultThumbnailSize),
532
537
);
533
538
@@ -538,7 +543,7 @@ class AssetEntity {
538
543
/// See also:
539
544
/// * [thumbnailData] which obtain the thumbnail data with fixed size.
540
545
/// * [thumbnailDataWithOption] which accepts customized [ThumbnailOption] .
541
- Future <Uint8List ?> thumbnailDataWithSize (
546
+ Future <typed_data. Uint8List ?> thumbnailDataWithSize (
542
547
ThumbnailSize size, {
543
548
ThumbnailFormat format = ThumbnailFormat .jpeg,
544
549
int quality = 100 ,
@@ -550,7 +555,7 @@ class AssetEntity {
550
555
}());
551
556
// Return null if the asset is audio or others.
552
557
if (type == AssetType .audio || type == AssetType .other) {
553
- return Future <Uint8List ?>.value ();
558
+ return Future <typed_data. Uint8List ?>.value ();
554
559
}
555
560
final ThumbnailOption option;
556
561
if (Platform .isIOS || Platform .isMacOS) {
@@ -579,7 +584,7 @@ class AssetEntity {
579
584
/// See also:
580
585
/// * [thumbnailData] which obtain the thumbnail data with fixed size.
581
586
/// * [thumbnailDataWithSize] which is a common method to obtain thumbnails.
582
- Future <Uint8List ?> thumbnailDataWithOption (
587
+ Future <typed_data. Uint8List ?> thumbnailDataWithOption (
583
588
ThumbnailOption option, {
584
589
PMProgressHandler ? progressHandler,
585
590
}) {
@@ -589,7 +594,7 @@ class AssetEntity {
589
594
}());
590
595
// Return null if the asset is audio or others.
591
596
if (type == AssetType .audio || type == AssetType .other) {
592
- return Future <Uint8List ?>.value ();
597
+ return Future <typed_data. Uint8List ?>.value ();
593
598
}
594
599
assert (() {
595
600
option.checkAssertions ();
@@ -684,7 +689,7 @@ class AssetEntity {
684
689
return File (path);
685
690
}
686
691
687
- Future <Uint8List ?> _getOriginBytes ({
692
+ Future <typed_data. Uint8List ?> _getOriginBytes ({
688
693
PMProgressHandler ? progressHandler,
689
694
}) async {
690
695
assert (
@@ -783,7 +788,7 @@ class AssetEntity {
783
788
}
784
789
785
790
@override
786
- int get hashCode => hashValues (id, isFavorite) ;
791
+ int get hashCode => id.hashCode ^ isFavorite.hashCode ;
787
792
788
793
@override
789
794
bool operator == (Object other) {
@@ -805,14 +810,14 @@ class LatLng {
805
810
final double ? latitude;
806
811
final double ? longitude;
807
812
808
- @override
809
- int get hashCode => hashValues (latitude, longitude);
810
-
811
813
@override
812
814
bool operator == (Object other) {
813
815
if (other is ! AssetEntity ) {
814
816
return false ;
815
817
}
816
818
return latitude == other.latitude && longitude == other.longitude;
817
819
}
820
+
821
+ @override
822
+ int get hashCode => latitude.hashCode ^ longitude.hashCode;
818
823
}
0 commit comments