Skip to content

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