From 9effcea49dd2b170426313db315e6e055cb6e9f3 Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 Date: Wed, 15 Jan 2025 10:48:05 +0300 Subject: [PATCH] animation fixes and remove unnecassary code --- .../circular_animated_widget.dart | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/lib/new_views/swipe_module/circular_animated_widget.dart b/lib/new_views/swipe_module/circular_animated_widget.dart index 7ede9c6d..0c486f79 100644 --- a/lib/new_views/swipe_module/circular_animated_widget.dart +++ b/lib/new_views/swipe_module/circular_animated_widget.dart @@ -3,71 +3,9 @@ import 'package:flutter/material.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; -class CircularAnimationWithProgressIndicator extends StatefulWidget { - Widget child; - CircularAnimationWithProgressIndicator({Key key, this.child}) : super(key: key); - @override - _CircularAnimationWithProgressIndicatorState createState() => - _CircularAnimationWithProgressIndicatorState(); -} - -class _CircularAnimationWithProgressIndicatorState - extends State - with SingleTickerProviderStateMixin { - AnimationController _controller; - - - @override - void initState() { - super.initState(); - // Animation controller for progress indicator - _controller = AnimationController( - vsync: this, - duration: const Duration(seconds: 40), // Duration of one full rotation - )..repeat(); // Repeat animation continuously - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - @override - Widget build(BuildContext context) { - return Center( - child: Stack( - alignment: Alignment.center, - children: [ - // Animated CircularProgressIndicator - AnimatedBuilder( - animation: _controller, - builder: (context, child) { - return Transform.rotate( - angle: _controller.value * 2 * 3.1416, // Full rotation - child: child, - ); - }, - child: SizedBox( - width: 100.toScreenHeight, - height: 100.toScreenWidth, - child: const CircularProgressIndicator( - strokeWidth: 3.0, - backgroundColor: AppColor.primary30, - - value: null, // Infinite animation - ), - ), - ), - // Static container in the center - widget.child?? const SizedBox(), - ], - ), - ); - } -} class CircularAnimatedContainer extends StatefulWidget { Widget child;