aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets/wake_word_command_processing.dart
diff options
context:
space:
mode:
authorAnuj Solanki <anuj603362@gmail.com>2024-09-29 15:57:43 +0530
committerAnuj Solanki <anuj603362@gmail.com>2024-09-29 16:16:41 +0530
commit053ba8d80e405ca84a0e179c1551c3d440829579 (patch)
treeafcbe6698afcef799d15f0730d6346e859a5e469 /lib/widgets/wake_word_command_processing.dart
parent539efac2637415a930b3077ff91abe003ce2fcd4 (diff)
Implemented auto-mode
- Implemented auto-mode in flutter-speechrecognition-demo to recognize the wake word and start the voice assistant automatically. Bug-AGL: SPEC-5200 Change-Id: Ic946a3f4535a7b16a4e45a5ffdf4a3b4015fdb6f Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
Diffstat (limited to 'lib/widgets/wake_word_command_processing.dart')
-rw-r--r--lib/widgets/wake_word_command_processing.dart61
1 files changed, 61 insertions, 0 deletions
diff --git a/lib/widgets/wake_word_command_processing.dart b/lib/widgets/wake_word_command_processing.dart
new file mode 100644
index 0000000..9872d36
--- /dev/null
+++ b/lib/widgets/wake_word_command_processing.dart
@@ -0,0 +1,61 @@
+import 'package:flutter/material.dart';
+
+class ProcessingCommandSection extends StatefulWidget {
+ @override
+ ProcessingCommandSectionState createState() => ProcessingCommandSectionState();
+}
+
+class ProcessingCommandSectionState extends State<ProcessingCommandSection>
+ with SingleTickerProviderStateMixin {
+ late AnimationController _controller;
+
+ @override
+ void initState() {
+ super.initState();
+
+ // Create an animation controller
+ _controller = AnimationController(
+ vsync: this,
+ duration: Duration(seconds: 2), // Adjust the duration as needed
+ );
+
+ // Start the animation
+ _controller.repeat();
+ }
+
+ @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.rotate(
+ angle: _controller.value * 2.0 * 3.1415927, // 2 * pi
+ child: Icon(
+ Icons.autorenew, // Replace with your processing icon
+ size: 60,
+ color: Colors.blueAccent,
+ ),
+ );
+ },
+ ),
+ SizedBox(height: 8),
+ Text(
+ 'Processing...',
+ style: TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ );
+ }
+} \ No newline at end of file