Skip to content

Commit 3f5ed1d

Browse files
committed
chore: Change rotating icon direction
1 parent 7545a33 commit 3f5ed1d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mobile/lib/features/trade/channel_creation_flow/channel_funding_screen.dart

+9-4
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class _ChannelFunding extends State<ChannelFunding> {
340340
switch (value) {
341341
case null:
342342
case FundingChannelTaskStatus.pending:
343-
loadingWidget = const RotatingIcon(icon: Icons.sync);
343+
loadingWidget = const RotatingIcon(icon: Icons.sync, reverse: true);
344344
break;
345345
case FundingChannelTaskStatus.funded:
346346
transactionStatusText = "Address funded";
@@ -367,7 +367,7 @@ class _ChannelFunding extends State<ChannelFunding> {
367367
switch (value) {
368368
case null:
369369
case FundingChannelTaskStatus.pending:
370-
loadingWidget = const RotatingIcon(icon: Icons.sync);
370+
loadingWidget = const RotatingIcon(icon: Icons.sync, reverse: true);
371371
break;
372372
case FundingChannelTaskStatus.funded:
373373
transactionStatusText = "Lightning payment received";
@@ -470,15 +470,17 @@ class ClickableBox extends StatelessWidget {
470470

471471
class RotatingIcon extends StatefulWidget {
472472
final IconData icon;
473+
final bool reverse;
473474

474-
const RotatingIcon({super.key, required this.icon});
475+
const RotatingIcon({super.key, required this.icon, this.reverse = false});
475476

476477
@override
477478
State<StatefulWidget> createState() => _RotatingIconState();
478479
}
479480

480481
class _RotatingIconState extends State<RotatingIcon> with SingleTickerProviderStateMixin {
481482
late AnimationController _controller;
483+
late Animation<double> _animation;
482484

483485
@override
484486
void initState() {
@@ -487,6 +489,9 @@ class _RotatingIconState extends State<RotatingIcon> with SingleTickerProviderSt
487489
duration: const Duration(seconds: 2),
488490
vsync: this,
489491
)..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);
490495
}
491496

492497
@override
@@ -498,7 +503,7 @@ class _RotatingIconState extends State<RotatingIcon> with SingleTickerProviderSt
498503
@override
499504
Widget build(BuildContext context) {
500505
return RotationTransition(
501-
turns: _controller,
506+
turns: _animation,
502507
child: Icon(
503508
widget.icon,
504509
size: 20.0,

0 commit comments

Comments
 (0)