remove unnecessary 'const', 'new' keyword and 'this.' qualifier.

This commit is contained in:
Wenqi Li 2023-08-01 19:21:15 +08:00
parent 1b9f6a0de0
commit c152bb6bbd
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ part 'src/models/medium.dart';
/// Accessing the native photo gallery.
class PhotoGallery {
static const MethodChannel _channel = const MethodChannel('photo_gallery');
static const MethodChannel _channel = MethodChannel('photo_gallery');
/// List all available gallery albums and counts number of items of [MediumType].
static Future<List<Album>> listAlbums({
@ -80,7 +80,7 @@ class PhotoGallery {
'highQuality': highQuality,
});
if (bytes == null) throw "Failed to fetch thumbnail of medium $mediumId";
return new List<int>.from(bytes);
return List<int>.from(bytes);
}
/// Get album thumbnail by album id
@ -101,7 +101,7 @@ class PhotoGallery {
'highQuality': highQuality,
});
if (bytes == null) throw "Failed to fetch thumbnail of album $albumId";
return new List<int>.from(bytes);
return List<int>.from(bytes);
}
/// get medium file by medium id

View File

@ -56,7 +56,7 @@ class Album {
}) {
return PhotoGallery.getAlbumThumbnail(
albumId: id,
mediumType: this.mediumType,
mediumType: mediumType,
width: width,
height: height,
highQuality: highQuality,