siri_wave 0.1.0 siri_wave: ^0.1.0 copied to clipboard
A Flutter package to create beautiful waveforms like in Siri.
SiriWave #
A Flutter package to create beautiful waveforms like in Siri. It was inspired from the siriwave library.
Demo #
Check out the live demo here.
iOS 7 style #
iOS 9 style #
Getting Started #
Requirements #
Dart >= 2.14.0
Flutter >= 2.0.0
Usage #
Simply create a SiriWave
widget:
import 'package:siri_wave/siri_wave.dart';
class MyWidget extends StatelessWidget {
Widget build(BuildContext context) {
return SiriWave();
}
}
To be able to change the amplitude and speed of the waveform, create a SiriWaveController
and pass it to the SiriWave
widget:
// You can change the default `amplitude` and `speed values` while creating the controller.
final controller = SiriWaveController();
SiriWave(controller: controller);
And then call setAmplitude
or setSpeed
methods in the controller.
controller.setAmplitude(0.8);
controller.setSpeed(0.1);
See the example directory for a complete sample app.
SiriWave #
Parameter | Type | Description | Default |
---|---|---|---|
controller |
SiriWaveController | The controller of the SiriWave. | SiriWaveController() |
options |
SiriWaveOptions | The configuration of the SiriWave. | SiriWaveOptions() |
style |
SiriWaveStyle | The wave style of the SiriWave. | SiriWaveStyle.ios_9 |
SiriWaveController #
Parameter | Type | Description | Default |
---|---|---|---|
amplitude |
double | The amplitude of the waveform. | 1.0 |
speed |
double | The speed of the waveform. | 0.2 |
Function | Description |
---|---|
setAmplitude(double value) |
Sets the amplitude of the waveform. The value must be in the [0,1] range. |
setSpeed(double value) |
Sets the speed of the waveform. The value must be in the [0,1] range |
SiriWaveOptions #
Parameter | Type | Description | Default |
---|---|---|---|
backgroundColor |
Color | The background color of the waveform. | Colors.black |
height |
double | The height of the waveform. | 180 |
width |
double | The width of the waveform. | 360 |
🤝 Contributing #
Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.