import 'package:flutter/material.dart'; class WakeWordRecording extends StatefulWidget { @override WakeWordRecordingState createState() => WakeWordRecordingState(); } class WakeWordRecordingState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; late Animation _bounceAnimation; @override void initState() { super.initState(); // Create an animation controller _controller = AnimationController( vsync: this, duration: Duration(milliseconds: 500), // Adjust the duration as needed ); // Create a bounce animation _bounceAnimation = Tween( begin: 0, end: 10, ).animate(CurvedAnimation( parent: _controller, curve: Curves.easeInOut, )); // Start the animation _controller.repeat(reverse: true); } @override void dispose() { _controller.dispose(); // Dispose of the animation controller super.dispose(); } @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AnimatedBuilder( animation: _controller, builder: (context, child) { return Transform.translate( offset: Offset(0, _bounceAnimation.value), child: Icon( Icons.mic, // Replace with your recording icon size: 60, color: Colors.redAccent, ), ); }, ), SizedBox(height: 8), Text( 'Recording...', style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold, ), ), ], ); } }