Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 0.6.2-wip
* Fixed JS interop to enable WebAssembly.
* Fixed native RSA public-key JWK imports to reject private key material.
* Upgrade `ffigen` and `hooks` versions.

# 0.6.1
* Added Dart native build hooks and native asset lookup for the bundled
Expand Down
54 changes: 29 additions & 25 deletions example/webcrypto_demo_flutter_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ void main() {
}

class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
_MyAppState createState() => _MyAppState();
MyAppState createState() => MyAppState();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we leave the demo changes out of this PR? They aren’t needed for the ffigen migration.

If the private return type was causing a lint, the narrower fix is:

State<MyApp> createState() => _MyAppState();

That keeps the state class private. The scrolling, spacing and deprecated-API cleanup would be easier to review separately.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just applied dart fix as a cleanup.

}

class _MyAppState extends State<MyApp> {
class MyAppState extends State<MyApp> {
String _output = '-';
final _input = TextEditingController();

Expand All @@ -37,29 +39,31 @@ class _MyAppState extends State<MyApp> {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('SHA-1 Hashing')),
body: Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Text(
'Compute SHA-1 hash of input below.\n\n'
'Click the button to refresh the computed output.'
'Output will be displayed in hexadecimal encoding.',
),
Text(
'input',
textScaleFactor: 1.2,
style: TextStyle(fontWeight: FontWeight.bold),
),
_textEntry(),
SizedBox(height: 50),
Text(
'output',
textScaleFactor: 1.2,
style: TextStyle(fontWeight: FontWeight.bold),
),
Text('$_output'),
],
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Text(
'Compute SHA-1 hash of input below.\n\n'
'Click the button to refresh the computed output.'
'Output will be displayed in hexadecimal encoding.',
),
Text(
'input',
textScaler: TextScaler.linear(1.2),
style: TextStyle(fontWeight: FontWeight.bold),
),
_textEntry(),
SizedBox(height: 20),
Text(
'output',
textScaler: TextScaler.linear(1.2),
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(_output),
],
),
),
),
),
Expand Down
43 changes: 0 additions & 43 deletions lib/src/boringssl/bindings/ffigen.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions lib/src/boringssl/bindings/generated_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
// ignore_for_file: type=lint, unused_import, deprecated_member_use_from_same_package
@ffi.DefaultAsset('package:webcrypto/webcrypto.dart')
library;

import 'dart:ffi' as ffi;

/// Helper function to get the size of CBB structure for FFI allocation.
@ffi.Native<ffi.Size Function()>(
symbol: 'webcrypto_get_CBB_size',
assetId: 'package:webcrypto/webcrypto.dart',
)
@ffi.Native<ffi.Size Function()>()
external int webcrypto_get_CBB_size();
Loading
Loading