Skip to content

fix: flutter 3.10 native bindings types for quick_js #125

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions lib/quickjs/qjs_typedefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import 'package:flutter_js/quickjs/utf8_null_terminated.dart';

class JSContext extends Struct {
@Uint8()
external int? char;
external int char;
}

class JSRuntime extends Struct {
@Uint8()
external int? char;
external int char;
}

class JSValueConst extends Struct {
@Uint8()
external int? char;
external int char;
}

const int JS_EVAL_TYPE_GLOBAL = 0;
Expand Down
4 changes: 2 additions & 2 deletions lib/quickjs/utf8_null_terminated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:ffi/ffi.dart';

class Utf8NullTerminated extends Struct {
@Uint8()
external int? char;
external int char;

static Pointer<Utf8NullTerminated> toUtf8(String s) {
final bytes = Utf8Encoder().convert(s);
Expand All @@ -25,7 +25,7 @@ class Utf8NullTerminated extends Struct {
while (true) {
final char = ptr.elementAt(len++).ref.char;
if (char == 0) break;
bytes.add(char!);
bytes.add(char);
}
return Utf8Decoder().convert(bytes);
}
Expand Down