Skip to content

support type alias #36

@huang12zheng

Description

@huang12zheng
type IS = String;

#[async_dart(namespace = "accounts")]
pub async fn contact(user_id: IS) -> Result<data::Contact, data::Error> {
  println!("async {:?}", thread::current().id());
  Ok(data::Contact {
    id: user_id.parse().unwrap(),
    ..data::Contact::default()
  })
}

would get error in dart

Future<Contact> contact({required String userId}) async {
Future<Contact> contact({required IS userId}) async {

final ptr = userId.toNativeUtf8().cast<Char>();

ffi.Pointer<ffi.Char> user_id,
ffi.Pointer<ffi.Uint8> user_id,
```·

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions