Skip to content

Commit

Permalink
Merge pull request #26 from natsuk4ze/more-stronger-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
natsuk4ze committed Jul 5, 2023
2 parents b4f7f90 + ff4bcd7 commit 5847d10
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.6.1

* UPDATE: We have made a stronger typing. `Gal`,`GalException`,`MethodChannelGal` has `@immutable` now.
* UPDATE: update README.

## 1.6.0

* UPDATE: Significantly improved error handling for low iOS versions. As a result, `GalExceptionType.unHandle` is now `@Deprecated` and will be removed in the next major version.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Add the following key to your _AndroidManifest_ file, located in
### Save from local

```dart
//Save Image
//Save Image (Supports two ways)
await Gal.putImage('$filePath');
await Gal.putImageBytes('$uint8List');
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.4.1"
version: "1.6.1"
http_parser:
dependency: transitive
description:
Expand Down
6 changes: 4 additions & 2 deletions lib/src/gal.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:gal/src/gal_exception.dart';

Expand All @@ -6,13 +7,14 @@ import 'gal_platform_interface.dart';
/// For detailed please see
/// https://github.com/natsuk4ze/gal/wiki
/// these functions are first called,
/// [putImage],[putVideo],[putImageBytes],a native dialog is
/// [putImage],[putVideo],[putImageBytes],a native dialog is
/// called asking the use for permission. If the user chooses to deny,
/// [GalException] of [GalExceptionType.accessDenied] will be throwed.
/// You should either do error handling or call [requestAccess] once
/// before calling these function.
@immutable
final class Gal {
Gal._();
const Gal._();

/// Save video to standard gallery app
/// [path] is local path.
Expand Down
6 changes: 5 additions & 1 deletion lib/src/gal_exception.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import 'package:flutter/foundation.dart';

/// Every [Exception] that [Gal] throws should be this.
@immutable
class GalException implements Exception {
GalException({
const GalException({
required this.type,
required this.error,
required this.stackTrace,
Expand Down
1 change: 1 addition & 0 deletions lib/src/gal_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
import 'gal_platform_interface.dart';

/// Plugin Communication
@immutable
final class MethodChannelGal extends GalPlatform {
@visibleForTesting
final methodChannel = const MethodChannel('gal');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: gal
description: Gal is a Flutter plugin for handle native gallary apps. Easily open or save media files to native gallery apps.
version: 1.6.0
version: 1.6.1
homepage: https://pub.dev/packages/gal
repository: https://github.com/natsuk4ze/gal

Expand Down

0 comments on commit 5847d10

Please sign in to comment.