diff --git a/Makefile b/Makefile index 8e4f091..bdb2ec1 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/example/lib/base64.dart b/example/lib/base64.dart index 3847eed..c9a8de3 100644 --- a/example/lib/base64.dart +++ b/example/lib/base64.dart @@ -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; diff --git a/example/lib/convert_jwt.dart b/example/lib/convert_jwt.dart index 73c601e..ad87b02 100644 --- a/example/lib/convert_jwt.dart +++ b/example/lib/convert_jwt.dart @@ -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; diff --git a/example/lib/convert_keypair.dart b/example/lib/convert_keypair.dart index cd47b82..72b7cbc 100644 --- a/example/lib/convert_keypair.dart +++ b/example/lib/convert_keypair.dart @@ -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; diff --git a/example/lib/convert_private.dart b/example/lib/convert_private.dart index a1f3e81..9c0ab2b 100644 --- a/example/lib/convert_private.dart +++ b/example/lib/convert_private.dart @@ -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; diff --git a/example/lib/convert_public.dart b/example/lib/convert_public.dart index c47450b..d46292a 100644 --- a/example/lib/convert_public.dart +++ b/example/lib/convert_public.dart @@ -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; diff --git a/example/lib/encrypt_decrypt_oaep.dart b/example/lib/encrypt_decrypt_oaep.dart index 3d9d930..deae0e5 100644 --- a/example/lib/encrypt_decrypt_oaep.dart +++ b/example/lib/encrypt_decrypt_oaep.dart @@ -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; diff --git a/example/lib/encrypt_decrypt_oaep_bytes.dart b/example/lib/encrypt_decrypt_oaep_bytes.dart index d838070..4e559a5 100644 --- a/example/lib/encrypt_decrypt_oaep_bytes.dart +++ b/example/lib/encrypt_decrypt_oaep_bytes.dart @@ -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; diff --git a/example/lib/encrypt_decrypt_pkcs.dart b/example/lib/encrypt_decrypt_pkcs.dart index c4580a5..89e9904 100644 --- a/example/lib/encrypt_decrypt_pkcs.dart +++ b/example/lib/encrypt_decrypt_pkcs.dart @@ -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; diff --git a/example/lib/encrypt_decrypt_pkcs_bytes.dart b/example/lib/encrypt_decrypt_pkcs_bytes.dart index b0344e6..0fb40d4 100644 --- a/example/lib/encrypt_decrypt_pkcs_bytes.dart +++ b/example/lib/encrypt_decrypt_pkcs_bytes.dart @@ -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; diff --git a/example/lib/encrypt_sign_pkcs.dart b/example/lib/encrypt_sign_pkcs.dart index fbd5e63..a2ff265 100644 --- a/example/lib/encrypt_sign_pkcs.dart +++ b/example/lib/encrypt_sign_pkcs.dart @@ -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; diff --git a/example/lib/encrypt_sign_pkcs_bytes.dart b/example/lib/encrypt_sign_pkcs_bytes.dart index 5d4bf40..c74e373 100644 --- a/example/lib/encrypt_sign_pkcs_bytes.dart +++ b/example/lib/encrypt_sign_pkcs_bytes.dart @@ -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; diff --git a/example/lib/encrypt_sign_pss.dart b/example/lib/encrypt_sign_pss.dart index abd0b46..1aa26e0 100644 --- a/example/lib/encrypt_sign_pss.dart +++ b/example/lib/encrypt_sign_pss.dart @@ -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; diff --git a/example/lib/encrypt_sign_pss_bytes.dart b/example/lib/encrypt_sign_pss_bytes.dart index 97833b3..ad7b606 100644 --- a/example/lib/encrypt_sign_pss_bytes.dart +++ b/example/lib/encrypt_sign_pss_bytes.dart @@ -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; diff --git a/example/lib/generate.dart b/example/lib/generate.dart index ab6051e..78622e6 100644 --- a/example/lib/generate.dart +++ b/example/lib/generate.dart @@ -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; diff --git a/example/lib/hash.dart b/example/lib/hash.dart index 884c5af..db9d9b4 100644 --- a/example/lib/hash.dart +++ b/example/lib/hash.dart @@ -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; diff --git a/example/pubspec.lock b/example/pubspec.lock index 1ba1871..40172e7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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 @@ -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: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 360748a..622fc80 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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 diff --git a/lib/fast_rsa.dart b/lib/fast_rsa.dart index dea19b8..66adb71 100644 --- a/lib/fast_rsa.dart +++ b/lib/fast_rsa.dart @@ -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 _call(String name, Uint8List payload) async { @@ -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!); } @@ -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!; } @@ -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; } @@ -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!); @@ -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( diff --git a/lib/web/rsa_web.dart b/lib/web/rsa_web.dart index 55d88a9..c84bdb7 100644 --- a/lib/web/rsa_web.dart +++ b/lib/web/rsa_web.dart @@ -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]; @@ -44,14 +44,14 @@ class FastRsaPlugin { completers.remove(data.id); } - worker.onmessage = _onMessage.toJS; + worker.onmessage = onMessage.toJS; // worker.addEventListener('message', _onMessage.toJS); } Future bridgeCall(String name, Uint8List? /*!*/ request) async { _counter++; var id = _counter.toString(); - var completer = new Completer(); + var completer = Completer(); completers[id] = completer; worker.postMessage(RsaRequest( id: id, diff --git a/pubspec.yaml b/pubspec.yaml index 832cb12..4092086 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: