Skip to content

Commit

Permalink
chore: codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Apr 8, 2024
1 parent 1bf9b5e commit 63d9ef7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions frb_example/pure_dart/lib/src/rust/api/dart_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class OpaqueStructWithDartCodeTwinNormal extends RustOpaque {
that: this,
hint: hint,
);

static int get dartCodeGetter => 123;
}

class TranslatableStructWithDartCodeTwinNormal {
Expand Down
2 changes: 2 additions & 0 deletions frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class OpaqueStructWithDartCodeTwinNormal extends RustOpaque {
that: this,
hint: hint,
);

static int get dartCodeGetter => 123;
}

class TranslatableStructWithDartCodeTwinNormal {
Expand Down
2 changes: 1 addition & 1 deletion frb_example/pure_dart_pde/rust/src/api/dart_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl TranslatableStructWithDartCodeTwinNormal {
}
}

#[frb(opaque, dart_code = "static int dartCodeGetter => 123;")]
#[frb(opaque, dart_code = "static int get dartCodeGetter => 123;")]
pub struct OpaqueStructWithDartCodeTwinNormal;

impl OpaqueStructWithDartCodeTwinNormal {
Expand Down
4 changes: 2 additions & 2 deletions frb_example/pure_dart_pde/test/api/dart_code_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Future<void> main({bool skipRustLibInit = false}) async {
final two = TranslatableStructWithDartCodeTwinNormal(a: 100);
expect(one.hashCode, two.hashCode);
expect(one == two, true);
expect(one.dartExtraMethod(), 200);
expect(await one.normalMethod(), 200);
expect(one.dartCodeMethod(), 200);
expect(await one.normalMethodTwinNormal(), 200);
});

test('OpaqueStructWithDartCodeTwinNormal', () async {
Expand Down

0 comments on commit 63d9ef7

Please sign in to comment.