From 63d9ef7b35f3e8a5367f7e57b4b01253b32c616a Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Mon, 8 Apr 2024 13:48:02 +0800 Subject: [PATCH] chore: codegen --- frb_example/pure_dart/lib/src/rust/api/dart_code.dart | 2 ++ frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart | 2 ++ frb_example/pure_dart_pde/rust/src/api/dart_code.rs | 2 +- frb_example/pure_dart_pde/test/api/dart_code_test.dart | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frb_example/pure_dart/lib/src/rust/api/dart_code.dart b/frb_example/pure_dart/lib/src/rust/api/dart_code.dart index 65ac1782a4..030cc984a6 100644 --- a/frb_example/pure_dart/lib/src/rust/api/dart_code.dart +++ b/frb_example/pure_dart/lib/src/rust/api/dart_code.dart @@ -30,6 +30,8 @@ class OpaqueStructWithDartCodeTwinNormal extends RustOpaque { that: this, hint: hint, ); + + static int get dartCodeGetter => 123; } class TranslatableStructWithDartCodeTwinNormal { diff --git a/frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart b/frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart index 7148a0cf65..5ab77cbea4 100644 --- a/frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart +++ b/frb_example/pure_dart_pde/lib/src/rust/api/dart_code.dart @@ -30,6 +30,8 @@ class OpaqueStructWithDartCodeTwinNormal extends RustOpaque { that: this, hint: hint, ); + + static int get dartCodeGetter => 123; } class TranslatableStructWithDartCodeTwinNormal { diff --git a/frb_example/pure_dart_pde/rust/src/api/dart_code.rs b/frb_example/pure_dart_pde/rust/src/api/dart_code.rs index 8b0f5ae14a..961f353c53 100644 --- a/frb_example/pure_dart_pde/rust/src/api/dart_code.rs +++ b/frb_example/pure_dart_pde/rust/src/api/dart_code.rs @@ -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 { diff --git a/frb_example/pure_dart_pde/test/api/dart_code_test.dart b/frb_example/pure_dart_pde/test/api/dart_code_test.dart index 65397062b2..44d1d75095 100644 --- a/frb_example/pure_dart_pde/test/api/dart_code_test.dart +++ b/frb_example/pure_dart_pde/test/api/dart_code_test.dart @@ -14,8 +14,8 @@ Future 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 {