Skip to content

Commit

Permalink
Update gal.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
natsuk4ze committed Aug 6, 2023
1 parent 469e055 commit 03b0e8d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/gal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ final class Gal {
/// if an error occurs during saving.
/// See: [Formats](https://github.com/natsuk4ze/gal/wiki/Formats)
static Future<void> putVideo(String path, {String? album}) async =>
_voidOrThrow(() async => GalPlatform.instance.putVideo(path));
_voidOrThrow(
() async => GalPlatform.instance.putVideo(path, album: album));

/// Save a image to the gallery from file [path].
///
/// Throws an [GalException] If you do not have access premission or
/// if an error occurs during saving.
/// See: [Formats](https://github.com/natsuk4ze/gal/wiki/Formats)
static Future<void> putImage(String path, {String? album}) async =>
_voidOrThrow(() async => GalPlatform.instance.putImage(path));
_voidOrThrow(
() async => GalPlatform.instance.putImage(path, album: album));

/// Save a image to the gallery from [Uint8List].
///
Expand All @@ -37,7 +39,8 @@ final class Gal {
/// if an error occurs during saving.
/// See: [Formats](https://github.com/natsuk4ze/gal/wiki/Formats)
static Future<void> putImageBytes(Uint8List bytes, {String? album}) async =>
_voidOrThrow(() async => GalPlatform.instance.putImageBytes(bytes));
_voidOrThrow(
() async => GalPlatform.instance.putImageBytes(bytes, album: album));

/// Open gallery app.
///
Expand Down

0 comments on commit 03b0e8d

Please sign in to comment.