### Install Dependencies Source: https://github.com/halildurmus/siri_wave/blob/main/CONTRIBUTING.md Navigate to the project directory and install all necessary project dependencies using Dart's package manager. ```cmd dart pub get ``` -------------------------------- ### Install Git Hooks Source: https://github.com/halildurmus/siri_wave/blob/main/CONTRIBUTING.md Set up Lefthook to manage Git hooks for the project. This ensures code quality and consistency checks are performed automatically before commits. ```cmd lefthook install ``` -------------------------------- ### Clone Siri Wave Repository Source: https://github.com/halildurmus/siri_wave/blob/main/CONTRIBUTING.md Clone the siri_wave repository to your local machine to begin contributing. Replace with your GitHub username. ```cmd git clone https://github.com//siri_wave.git ``` -------------------------------- ### Control iOS 7 Waveform Properties with IOS7SiriWaveformController Source: https://context7.com/halildurmus/siri_wave/llms.txt Demonstrates initializing the controller and binding its properties to UI sliders and buttons for real-time waveform manipulation. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS7ControllerExample extends StatefulWidget { const iOS7ControllerExample({super.key}); @override State createState() => _iOS7ControllerExampleState(); } class _iOS7ControllerExampleState extends State { // Create controller with initial values final controller = IOS7SiriWaveformController( amplitude: 1.0, // Default: 1.0, Range: [0, 1] speed: 0.2, // Default: 0.2, Range: [0, 1] color: Colors.white, // Default: Colors.white frequency: 6, // Default: 6, Range: [-20, 20] ); @override Widget build(BuildContext context) { return Column( children: [ SiriWaveform.ios7(controller: controller), // Amplitude slider - controls wave height Slider( value: controller.amplitude, min: 0, max: 1, onChanged: (value) { setState(() => controller.amplitude = value); }, ), // Speed slider - controls animation speed Slider( value: controller.speed, min: 0, max: 1, onChanged: (value) { setState(() => controller.speed = value); }, ), // Frequency slider - controls wave density Slider( value: controller.frequency.toDouble(), min: -20, max: 20, divisions: 40, onChanged: (value) { setState(() => controller.frequency = value.round()); }, ), // Color buttons Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ElevatedButton( onPressed: () => setState(() => controller.color = Colors.red), child: const Text('Red'), ), ElevatedButton( onPressed: () => setState(() => controller.color = Colors.green), child: const Text('Green'), ), ElevatedButton( onPressed: () => setState(() => controller.color = Colors.blue), child: const Text('Blue'), ), ], ), ], ); } } ``` -------------------------------- ### Initialize iOS 7 Siri Waveform Source: https://github.com/halildurmus/siri_wave/blob/main/README.md Basic implementation of the iOS 7 style waveform using the SiriWaveform.ios7 constructor. ```dart import 'package:siri_wave/siri_wave.dart'; class MyWidget extends StatelessWidget { MyWidget({super.key}); Widget build(BuildContext context) => SiriWaveform.ios7(); } ``` -------------------------------- ### Initialize iOS 9 Siri Waveform Source: https://github.com/halildurmus/siri_wave/blob/main/README.md Basic implementation of the iOS 9 style waveform using the SiriWaveform.ios9 constructor. ```dart import 'package:siri_wave/siri_wave.dart'; class MyWidget extends StatelessWidget { MyWidget({super.key}); Widget build(BuildContext context) => SiriWaveform.ios9(); } ``` -------------------------------- ### Implement Direct iOS 9 Waveform Widget Source: https://context7.com/halildurmus/siri_wave/llms.txt Use the IOS9SiriWaveform widget for direct control over the support bar parameter. Requires an IOS9SiriWaveformController for managing animation properties. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class DirectiOS9WaveformExample extends StatelessWidget { const DirectiOS9WaveformExample({super.key}); @override Widget build(BuildContext context) { final controller = IOS9SiriWaveformController( amplitude: 0.9, speed: 0.15, color1: Colors.pink, color2: Colors.purple, color3: Colors.deepPurple, ); // Direct usage of the underlying widget return SizedBox( height: 200, width: double.infinity, child: IOS9SiriWaveform( controller: controller, showSupportBar: false, // Directly control support bar ), ); } } ``` -------------------------------- ### Run Tests Source: https://github.com/halildurmus/siri_wave/blob/main/CONTRIBUTING.md Execute all project tests using the Dart test runner. It is required to have tests for each feature or bug fix. ```cmd dart test ``` -------------------------------- ### Integrate Waveform into Voice Assistant UI Source: https://context7.com/halildurmus/siri_wave/llms.txt Demonstrates a stateful implementation where the waveform amplitude and speed respond to user interaction. Uses the SiriWaveform.ios9 factory constructor. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class VoiceAssistantExample extends StatefulWidget { const VoiceAssistantExample({super.key}); @override State createState() => _VoiceAssistantExampleState(); } class _VoiceAssistantExampleState extends State { final controller = IOS9SiriWaveformController( amplitude: 0, // Start with no animation speed: 0.2, ); bool isListening = false; void _toggleListening() { setState(() { isListening = !isListening; // Animate amplitude based on listening state controller.amplitude = isListening ? 1.0 : 0.0; controller.speed = isListening ? 0.25 : 0.1; }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.black, body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ // Waveform visualization Container( height: 200, width: double.infinity, margin: const EdgeInsets.all(20), child: SiriWaveform.ios9( controller: controller, options: const IOS9SiriWaveformOptions( height: 200, width: double.infinity, showSupportBar: true, ), ), ), const SizedBox(height: 40), // Status text Text( isListening ? 'Listening...' : 'Tap to speak', style: const TextStyle( color: Colors.white, fontSize: 18, ), ), const SizedBox(height: 20), // Microphone button GestureDetector( onTap: _toggleListening, child: Container( width: 80, height: 80, decoration: BoxDecoration( shape: BoxShape.circle, color: isListening ? Colors.red : Colors.blue, ), child: Icon( isListening ? Icons.mic : Icons.mic_none, color: Colors.white, size: 40, ), ), ), ], ), ), ); } } ``` -------------------------------- ### Switch Between iOS 7 and iOS 9 Waveform Styles Source: https://context7.com/halildurmus/siri_wave/llms.txt Dynamically render waveform based on the selected style using `SiriWaveformStyle`. Requires a `SiriWaveformController` appropriate for the chosen style. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class StyleSwitcherExample extends StatefulWidget { const StyleSwitcherExample({super.key}); @override State createState() => _StyleSwitcherExampleState(); } class _StyleSwitcherExampleState extends State { SiriWaveformStyle selectedStyle = SiriWaveformStyle.ios_9; SiriWaveformController controller = IOS9SiriWaveformController(); @override Widget build(BuildContext context) { return Column( children: [ // Dynamically render based on selected style if (selectedStyle == SiriWaveformStyle.ios_7) SiriWaveform.ios7( controller: controller as IOS7SiriWaveformController, ) else SiriWaveform.ios9( controller: controller as IOS9SiriWaveformController, ), const SizedBox(height: 20), // Style toggle buttons ToggleButtons( isSelected: [ selectedStyle == SiriWaveformStyle.ios_7, selectedStyle == SiriWaveformStyle.ios_9, ], onPressed: (index) { setState(() { if (index == 0) { selectedStyle = SiriWaveformStyle.ios_7; controller = IOS7SiriWaveformController(); } else { selectedStyle = SiriWaveformStyle.ios_9; controller = IOS9SiriWaveformController(); } }); }, children: const [ Padding( padding: EdgeInsets.symmetric(horizontal: 16), child: Text('iOS 7'), ), Padding( padding: EdgeInsets.symmetric(horizontal: 16), child: Text('iOS 9'), ), ], ), ], ); } } ``` -------------------------------- ### Create iOS 7 Style Waveform Source: https://context7.com/halildurmus/siri_wave/llms.txt Use SiriWaveform.ios7() for a basic iOS 7 style waveform. For advanced customization, utilize IOS7SiriWaveformController and IOS7SiriWaveformOptions to control amplitude, color, frequency, speed, height, and width. Properties can be updated dynamically. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS7WaveformExample extends StatelessWidget { const iOS7WaveformExample({super.key}); @override Widget build(BuildContext context) { // Basic usage with default settings return SiriWaveform.ios7(); } } ``` ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class CustomiOS7WaveformExample extends StatefulWidget { const CustomiOS7WaveformExample({super.key}); @override State createState() => _CustomiOS7WaveformExampleState(); } class _CustomiOS7WaveformExampleState extends State { final controller = IOS7SiriWaveformController( amplitude: 0.8, // Wave height intensity [0, 1] color: Colors.blue, // Waveform color frequency: 8, // Wave frequency [-20, 20] speed: 0.25, // Animation speed [0, 1] ); @override Widget build(BuildContext context) { return Column( children: [ SiriWaveform.ios7( controller: controller, options: const IOS7SiriWaveformOptions( height: 200, width: 400, ), ), // Dynamically update properties ElevatedButton( onPressed: () { controller.amplitude = 0.3; controller.color = Colors.red; controller.frequency = 4; controller.speed = 0.1; }, child: const Text('Change Properties'), ), ], ); } } ``` -------------------------------- ### Configure iOS 9 Waveform Dimensions and Support Bar Source: https://context7.com/halildurmus/siri_wave/llms.txt Customize waveform height, width, and toggle the visibility of the support bar. The support bar is a horizontal line at the center of the waveform. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS9OptionsExample extends StatefulWidget { const iOS9OptionsExample({super.key}); @override State createState() => _iOS9OptionsExampleState(); } class _iOS9OptionsExampleState extends State { bool showSupportBar = true; @override Widget build(BuildContext context) { return Column( children: [ // Default size with support bar (180 x 360, showSupportBar: true) SiriWaveform.ios9(), const SizedBox(height: 20), // Custom size without support bar SiriWaveform.ios9( options: const IOS9SiriWaveformOptions( height: 200, width: 500, showSupportBar: false, // Hide the horizontal line ), ), const SizedBox(height: 20), // Dynamic support bar toggle SiriWaveform.ios9( options: IOS9SiriWaveformOptions( height: 180, width: double.infinity, showSupportBar: showSupportBar, ), ), SwitchListTile( title: const Text('Show Support Bar'), value: showSupportBar, onChanged: (value) => setState(() => showSupportBar = value), ), ], ); } } ``` -------------------------------- ### Direct iOS 7 Waveform Widget Usage Source: https://context7.com/halildurmus/siri_wave/llms.txt Use the `IOS7SiriWaveform` widget directly for more control over the widget lifecycle or integration with the animation system. Allows customization of amplitude, color, frequency, and speed. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class DirectiOS7WaveformExample extends StatelessWidget { const DirectiOS7WaveformExample({super.key}); @override Widget build(BuildContext context) { final controller = IOS7SiriWaveformController( amplitude: 0.8, color: Colors.cyan, frequency: 5, speed: 0.2, ); // Direct usage of the underlying widget return SizedBox( height: 200, width: double.infinity, child: IOS7SiriWaveform( controller: controller, ), ); } } ``` -------------------------------- ### Create iOS 9 Style Waveform Source: https://context7.com/halildurmus/siri_wave/llms.txt Use SiriWaveform.ios9() for a basic iOS 9 style waveform with multiple color layers. Advanced customization involves IOS9SiriWaveformController and IOS9SiriWaveformOptions to adjust amplitude, speed, colors, height, width, and the support bar. Properties can be updated dynamically. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS9WaveformExample extends StatelessWidget { const iOS9WaveformExample({super.key}); @override Widget build(BuildContext context) { // Basic usage with default settings return SiriWaveform.ios9(); } } ``` ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class CustomiOS9WaveformExample extends StatefulWidget { const CustomiOS9WaveformExample({super.key}); @override State createState() => _CustomiOS9WaveformExampleState(); } class _CustomiOS9WaveformExampleState extends State { final controller = IOS9SiriWaveformController( amplitude: 0.7, // Wave intensity [0, 1] speed: 0.15, // Animation speed [0, 1] color1: const Color(0xFFFF006E), // Primary wave color (pink) color2: const Color(0xFF00D9FF), // Secondary wave color (cyan) color3: const Color(0xFF8338EC), // Tertiary wave color (purple) ); @override Widget build(BuildContext context) { return Column( children: [ SiriWaveform.ios9( controller: controller, options: const IOS9SiriWaveformOptions( height: 250, width: 500, showSupportBar: true, // Show horizontal support bar ), ), // Dynamically update colors ElevatedButton( onPressed: () { controller.color1 = Colors.orange; controller.color2 = Colors.green; controller.color3 = Colors.blue; controller.amplitude = 0.5; }, child: const Text('Change Colors'), ), ], ); } } ``` -------------------------------- ### Configure iOS 7 Waveform Dimensions Source: https://context7.com/halildurmus/siri_wave/llms.txt Customize the height and width of the iOS 7 waveform using `IOS7SiriWaveformOptions`. The default dimensions are 180 pixels high and 360 pixels wide. `double.infinity` can be used for full width. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS7OptionsExample extends StatelessWidget { const iOS7OptionsExample({super.key}); @override Widget build(BuildContext context) { return Column( children: [ // Default size (180 x 360) SiriWaveform.ios7(), const SizedBox(height: 20), // Custom size SiriWaveform.ios7( options: const IOS7SiriWaveformOptions( height: 100, // Default: 180 width: 300, // Default: 360 ), ), const SizedBox(height: 20), // Full width using double.infinity SiriWaveform.ios7( options: const IOS7SiriWaveformOptions( height: 150, width: double.infinity, ), ), const SizedBox(height: 20), // Alternative: Use SizedBox to constrain dimensions SizedBox( height: 120, width: 250, child: SiriWaveform.ios7(), ), ], ); } } ``` -------------------------------- ### Control iOS 9 Waveform Properties Source: https://context7.com/halildurmus/siri_wave/llms.txt Use `IOS9SiriWaveformController` to manage amplitude, speed, and colors. Amplitude and speed range from 0 to 1. Colors can be set using `Color` objects. ```dart import 'package:flutter/material.dart'; import 'package:siri_wave/siri_wave.dart'; class iOS9ControllerExample extends StatefulWidget { const iOS9ControllerExample({super.key}); @override State createState() => _iOS9ControllerExampleState(); } class _iOS9ControllerExampleState extends State { // Create controller with custom colors final controller = IOS9SiriWaveformController( amplitude: 1.0, // Default: 1.0, Range: [0, 1] speed: 0.2, // Default: 0.2, Range: [0, 1] color1: const Color(0xFFAD394C), // Default: red-ish color2: const Color(0xFF30DC9B), // Default: green-ish color3: const Color(0xFF0F52A9), // Default: blue-ish ); @override Widget build(BuildContext context) { return Column( children: [ SiriWaveform.ios9(controller: controller), // Amplitude control Row( children: [ const Text('Amplitude:'), Expanded( child: Slider( value: controller.amplitude, min: 0, max: 1, onChanged: (value) { setState(() => controller.amplitude = value); }, ), ), ], ), // Speed control Row( children: [ const Text('Speed:'), Expanded( child: Slider( value: controller.speed, min: 0, max: 1, onChanged: (value) { setState(() => controller.speed = value); }, ), ), ], ), // Color presets Wrap( spacing: 8, children: [ ElevatedButton( onPressed: () => setState(() { controller.color1 = Colors.red; controller.color2 = Colors.orange; controller.color3 = Colors.yellow; }), child: const Text('Warm'), ), ElevatedButton( onPressed: () => setState(() { controller.color1 = Colors.blue; controller.color2 = Colors.cyan; controller.color3 = Colors.teal; }), child: const Text('Cool'), ), ElevatedButton( onPressed: () => setState(() { controller.color1 = Colors.purple; controller.color2 = Colors.pink; controller.color3 = Colors.indigo; }), child: const Text('Vibrant'), ), ], ), ], ); } } ``` -------------------------------- ### Customize iOS 7 Siri Waveform Source: https://github.com/halildurmus/siri_wave/blob/main/README.md Configure the iOS 7 waveform appearance and behavior using IOS7SiriWaveformController and IOS7SiriWaveformOptions. ```dart class MyWidget extends StatelessWidget { MyWidget({super.key}); final controller = IOS7SiriWaveformController( amplitude: 0.5, color: Colors.red, frequency: 4, speed: 0.15, ); @override Widget build(BuildContext context) => SiriWaveform.ios7( controller: controller, options: const IOS7SiriWaveformOptions(height: 200, width: 400), ); } ``` -------------------------------- ### Conventional Commit Message Format Source: https://github.com/halildurmus/siri_wave/blob/main/CONTRIBUTING.md Use the Conventional Commits format for commit messages to ensure clarity and uniformity. This format is validated by a GitHub action. ```text (optional scope): ``` ```text feat: add support for changing color of the iOS 7 style waveform ``` ```text fix: resolve an issue with the light backgrounds ``` -------------------------------- ### Customize iOS 9 Siri Waveform Source: https://github.com/halildurmus/siri_wave/blob/main/README.md Configure the iOS 9 waveform appearance and behavior using IOS9SiriWaveformController and IOS9SiriWaveformOptions. ```dart class MyWidget extends StatelessWidget { MyWidget({super.key}); final controller = IOS9SiriWaveformController( amplitude: 0.5, color1: Colors.red, color2: Colors.green, color3: Colors.blue, speed: 0.15, ); @override Widget build(BuildContext context) => SiriWaveform.ios9( controller: controller, options: const IOS9SiriWaveformOptions(height: 200, width: 400), ); } ``` -------------------------------- ### Update iOS 7 Waveform Properties Source: https://github.com/halildurmus/siri_wave/blob/main/README.md Modify waveform controller properties dynamically after initialization. ```dart controller.amplitude = 0.3; controller.color = Colors.white; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.