Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More stronger typing #26

Merged
merged 4 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading