@@ -340,7 +340,7 @@ class _ChannelFunding extends State<ChannelFunding> {
340
340
switch (value) {
341
341
case null :
342
342
case FundingChannelTaskStatus .pending:
343
- loadingWidget = const RotatingIcon (icon: Icons .sync );
343
+ loadingWidget = const RotatingIcon (icon: Icons .sync , reverse : true );
344
344
break ;
345
345
case FundingChannelTaskStatus .funded:
346
346
transactionStatusText = "Address funded" ;
@@ -367,7 +367,7 @@ class _ChannelFunding extends State<ChannelFunding> {
367
367
switch (value) {
368
368
case null :
369
369
case FundingChannelTaskStatus .pending:
370
- loadingWidget = const RotatingIcon (icon: Icons .sync );
370
+ loadingWidget = const RotatingIcon (icon: Icons .sync , reverse : true );
371
371
break ;
372
372
case FundingChannelTaskStatus .funded:
373
373
transactionStatusText = "Lightning payment received" ;
@@ -470,15 +470,17 @@ class ClickableBox extends StatelessWidget {
470
470
471
471
class RotatingIcon extends StatefulWidget {
472
472
final IconData icon;
473
+ final bool reverse;
473
474
474
- const RotatingIcon ({super .key, required this .icon});
475
+ const RotatingIcon ({super .key, required this .icon, this .reverse = false });
475
476
476
477
@override
477
478
State <StatefulWidget > createState () => _RotatingIconState ();
478
479
}
479
480
480
481
class _RotatingIconState extends State <RotatingIcon > with SingleTickerProviderStateMixin {
481
482
late AnimationController _controller;
483
+ late Animation <double > _animation;
482
484
483
485
@override
484
486
void initState () {
@@ -487,6 +489,9 @@ class _RotatingIconState extends State<RotatingIcon> with SingleTickerProviderSt
487
489
duration: const Duration (seconds: 2 ),
488
490
vsync: this ,
489
491
)..repeat (); // Repeats the animation indefinitely
492
+
493
+ _animation = Tween <double >(begin: widget.reverse ? 1.0 : 0.0 , end: widget.reverse ? 0.0 : 1.0 )
494
+ .animate (_controller);
490
495
}
491
496
492
497
@override
@@ -498,7 +503,7 @@ class _RotatingIconState extends State<RotatingIcon> with SingleTickerProviderSt
498
503
@override
499
504
Widget build (BuildContext context) {
500
505
return RotationTransition (
501
- turns: _controller ,
506
+ turns: _animation ,
502
507
child: Icon (
503
508
widget.icon,
504
509
size: 20.0 ,
0 commit comments