1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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,
),
),
],
);
}
}
|