Skip to content

Commit 58f2990

Browse files
committed
added custom exception
1 parent 256ce99 commit 58f2990

File tree

9 files changed

+26
-20
lines changed

9 files changed

+26
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.3
2+
3+
- Added OpenPGPException
4+
15
## 1.1.2
26

37
- Tests CI and github actions for drive

analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
analyzer:
2+
exclude:
3+
- example/**
4+
- lib/model/**
5+
- lib/bridge/**

example/pubspec.lock

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,6 @@ packages:
208208
url: "https://pub.dartlang.org"
209209
source: hosted
210210
version: "0.6.3-nullsafety.3"
211-
json_rpc_2:
212-
dependency: transitive
213-
description:
214-
name: json_rpc_2
215-
url: "https://pub.dartlang.org"
216-
source: hosted
217-
version: "2.2.2"
218211
logging:
219212
dependency: transitive
220213
description:
@@ -270,7 +263,7 @@ packages:
270263
path: ".."
271264
relative: true
272265
source: path
273-
version: "1.1.2"
266+
version: "1.1.3"
274267
package_config:
275268
dependency: transitive
276269
description:
@@ -494,5 +487,5 @@ packages:
494487
source: hosted
495488
version: "2.2.1"
496489
sdks:
497-
dart: ">=2.12.0-0.0 <=2.12.0-141.0.dev"
498-
flutter: ">=1.10.0 <2.0.0"
490+
dart: ">=2.12.0-0.0 <=2.12.0-259.8.beta"
491+
flutter: ">=1.10.0"

example/pubspec.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ dependencies:
1313
sdk: flutter
1414

1515
openpgp:
16-
# When depending on this package from a real application you should use:
17-
# openpgp: ^x.y.z
18-
# See https://dart.dev/tools/pub/dependencies#version-constraints
19-
# The example app is bundled with the plugin so we use a path dependency on
20-
# the parent directory to use the current plugin's version.
2116
path: ../
2217

2318
# The following adds the Cupertino Icons font to your application.

lib/bridge/binding.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:typed_data';
88
import 'package:ffi/ffi.dart';
99
import 'package:openpgp/bridge/ffi.dart';
1010
import 'package:openpgp/bridge/isolate.dart';
11+
import 'package:openpgp/openpgp.dart';
1112

1213
class Binding {
1314
static final String _callFuncName = 'OpenPGPBridgeCall';
@@ -82,7 +83,7 @@ class Binding {
8283
if (error.address != ffi.nullptr.address) {
8384
var message = fromUtf8(error);
8485
freeHere(pointer);
85-
throw message;
86+
throw new OpenPGPException(message);
8687
}
8788
}
8889

lib/openpgp.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import 'package:openpgp/bridge/binding_stub.dart'
77
if (dart.library.js) 'package:openpgp/bridge/binding_stub.dart';
88
import 'package:openpgp/model/bridge.pb.dart';
99

10+
class OpenPGPException implements Exception {
11+
String cause;
12+
OpenPGPException(this.cause);
13+
}
14+
1015
class OpenPGP {
1116
static const MethodChannel _channel = const MethodChannel('openpgp');
1217
static bool bindingEnabled = Binding().isSupported();

lib/web/openpgp_web.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ class OpenpgpPlugin {
1212
Map<String, Completer<Uint8List>> completers = {};
1313

1414
static void registerWith(Registrar registrar) {
15-
final MethodChannel channel =
16-
MethodChannel('openpgp', const StandardMethodCodec(), registrar.messenger);
15+
final MethodChannel channel = MethodChannel(
16+
'openpgp',
17+
const StandardMethodCodec(),
18+
// ignore: deprecated_member_use
19+
registrar.messenger);
1720
final OpenpgpPlugin instance = OpenpgpPlugin();
1821
instance.listen();
1922
channel.setMethodCallHandler(instance.handleMethodCall);

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,4 @@ packages:
177177
version: "2.1.0-nullsafety.5"
178178
sdks:
179179
dart: ">=2.12.0-0.0 <3.0.0"
180-
flutter: ">=1.10.0 <2.0.0"
180+
flutter: ">=1.10.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openpgp
22
description: library for use OpenPGP with support for android and ios, macOS, linux, windows, web and hover
3-
version: 1.1.2
3+
version: 1.1.3
44
homepage: https://github.com/jerson/flutter-openpgp
55

66
environment:

0 commit comments

Comments
 (0)