Skip to content

Expose the api to use c structs on native platforms #1

Description

@dariyooo

I am trying to include a ffi package on web, but not actually use it. On web I want to use a JS library. However, just by including dart:ffi compiler errors crop up.
Therefore, I would like to use this package as a small wrapper to 'make the compiler happy'.
While this works, I get a lot of weird linting errors because my package uses c structs.

'TfLiteTensor' doesn't conform to the bound 'NativeType' of the type parameter 'T'.
Try using a type that is or is a subclass of 'NativeType'.dart[type_argument_not_matching_bounds](https://dart.dev/diagnostics/type_argument_not_matching_bounds)
tensorflow_lite_bindings_generated.dart(770, 20): The inverted type 'Pointer<TfLiteTensor>' is also not regular-bounded, so the type is not well-bounded.

Is there any way to do this?

I would like to do something like this

final class TfLiteDelegate extends ffi.Struct {

that does not crash on web;

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