Skip to content
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

Generation of default struct #2136

Closed
Larpoux opened this issue Jun 21, 2024 · 5 comments · Fixed by #2150
Closed

Generation of default struct #2136

Larpoux opened this issue Jun 21, 2024 · 5 comments · Fixed by #2150
Labels
enhancement New feature or request

Comments

@Larpoux
Copy link
Contributor

Larpoux commented Jun 21, 2024

/// Creates and returns a new `AudioContext` object.
  ///
  /// This will play live audio on the default output device.
  ///
  /// ```no_run
  /// use web_audio_api::context::{AudioContext, AudioContextOptions};
  ///
  /// // Request a sample rate of 44.1 kHz and default latency (buffer size 128, if available)
  /// let opts = AudioContextOptions {
  ///     sample_rate: Some(44100.),
  ///     ..AudioContextOptions::default()
  /// };
  ///
  /// // Setup the audio context that will emit to your speakers
  /// let context = AudioContext::new(opts);
  ///
  /// // Alternatively, use the default constructor to get the best settings for your hardware
  /// // let context = AudioContext::default();

I would like to do something like :
AudioContext audioCtx = AudioContext.def(); // default is a dart reserved word

@Larpoux Larpoux added the enhancement New feature or request label Jun 21, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented Jun 21, 2024

@Larpoux
Copy link
Contributor Author

Larpoux commented Jun 21, 2024

I think that frb does not generates default struct.

@fzyzcjy
Copy link
Owner

fzyzcjy commented Jun 21, 2024

One workaround is to use https://cjycode.com/flutter_rust_bridge/guides/third-party/automatic/override-methods to add a method; Or, I will implement the default struct thing later.

@fzyzcjy
Copy link
Owner

fzyzcjy commented Jun 24, 2024

It is being implemented in #2150. After that is released, I personally suggest to copy-paste the updated contents in frb_example/integrate_third_party, because that PR allows scanning more things, and then we do need to configure a bit more.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
2 participants