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

Added ability to change wave amplitude #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sp-nazar
Copy link

@sp-nazar sp-nazar commented Jun 7, 2023

#46 Fix not able to change wave amplitude in runtime.

Test plan

  1. Pass some waveAmplitude to the WaveWidget.
  2. Change waveAmplitude in runtime.
  3. The changes should be applied to the waves.

How it works
Regenerate _waveAmplitudes on changes of waveAmplitude parameters of WaveWidget:

@override
void didUpdateWidget(covariant WaveWidget oldWidget) {
  super.didUpdateWidget(oldWidget);
  if (oldWidget.waveAmplitude != widget.waveAmplitude) {
    _waveAmplitudes = List.filled(
      _waveAmplitudes.length,
      widget.waveAmplitude + 10,
    );
  }
}

Closing issues #46

@vercel
Copy link

vercel bot commented Jun 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wave ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 9:25am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant