Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed Nov 30, 2024
1 parent 777acdb commit 61a0471
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 29 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ default: test
test:
cd example && flutter test integration_test/app_test.dart

fmt:
dart format . && dart fix --apply
cd example && dart format . && dart fix --apply

upgrade: upgrade-libs upgrade-flatbuffers

upgrade-libs:
Expand Down
2 changes: 1 addition & 1 deletion example/lib/base64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Base64 extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/convert_jwt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ConvertJWT extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/convert_keypair.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ConvertKeyPair extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/convert_private.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ConvertPrivate extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/convert_public.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ConvertPublic extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_decrypt_oaep.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EncryptAndDecryptOAEP extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_decrypt_oaep_bytes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EncryptAndDecryptOAEPBytes extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_decrypt_pkcs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EncryptAndDecryptPKCS extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_decrypt_pkcs_bytes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EncryptAndDecryptPKCSBytes extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_sign_pkcs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SignAndVerifyPKCS extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_sign_pkcs_bytes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SignAndVerifyPKCSBytes extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_sign_pss.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SignAndVerifyPSS extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/encrypt_sign_pss_bytes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SignAndVerifyPSSBytes extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Generate extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/hash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class HashExample extends StatefulWidget {
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair;
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -255,10 +255,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
logging:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

test: any

Expand Down
12 changes: 6 additions & 6 deletions lib/fast_rsa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PKCS12KeyPair {
}

class RSA {
static const MethodChannel _channel = const MethodChannel('fast_rsa');
static const MethodChannel _channel = MethodChannel('fast_rsa');
static bool bindingEnabled = Binding().isSupported();

static Future<Uint8List> _call(String name, Uint8List payload) async {
Expand All @@ -55,7 +55,7 @@ class RSA {
var data = await _call(name, payload);
var response = model.BytesResponse(data);
if (response.error != null && response.error != "") {
throw new RSAException(response.error!);
throw RSAException(response.error!);
}
return Uint8List.fromList(response.output!);
}
Expand All @@ -64,7 +64,7 @@ class RSA {
var data = await _call(name, payload);
var response = model.StringResponse(data);
if (response.error != null && response.error != "") {
throw new RSAException(response.error!);
throw RSAException(response.error!);
}
return response.output!;
}
Expand All @@ -73,7 +73,7 @@ class RSA {
var data = await _call(name, payload);
var response = model.BoolResponse(data);
if (response.error != null && response.error != "") {
throw new RSAException(response.error!);
throw RSAException(response.error!);
}
return response.output;
}
Expand All @@ -83,7 +83,7 @@ class RSA {
var data = await _call(name, payload);
var response = model.KeyPairResponse(data);
if (response.error != null && response.error != "") {
throw new RSAException(response.error!);
throw RSAException(response.error!);
}
var output = response.output!;
return KeyPair(output.publicKey!, output.privateKey!);
Expand All @@ -94,7 +94,7 @@ class RSA {
var data = await _call(name, payload);
var response = model.Pkcs12KeyPairResponse(data);
if (response.error != null && response.error != "") {
throw new RSAException(response.error!);
throw RSAException(response.error!);
}
var output = response.output!;
return PKCS12KeyPair(
Expand Down
6 changes: 3 additions & 3 deletions lib/web/rsa_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FastRsaPlugin {
}

void listen() async {
void _onMessage(Event event) {
void onMessage(Event event) {
final msgEvent = event as MessageEvent;
final data = msgEvent.data as RsaResponse;
var completer = completers[data.id];
Expand All @@ -44,14 +44,14 @@ class FastRsaPlugin {
completers.remove(data.id);
}

worker.onmessage = _onMessage.toJS;
worker.onmessage = onMessage.toJS;
// worker.addEventListener('message', _onMessage.toJS);
}

Future<Uint8List> bridgeCall(String name, Uint8List? /*!*/ request) async {
_counter++;
var id = _counter.toString();
var completer = new Completer<Uint8List>();
var completer = Completer<Uint8List>();
completers[id] = completer;
worker.postMessage(RsaRequest(
id: id,
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
path: ^1.9.0
web: ">=0.5.0 <2.0.0"
plugin_platform_interface: ^2.0.2
flutter_lints: ^5.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 61a0471

Please sign in to comment.