feat : new loading widget

This commit is contained in:
2025-09-20 13:13:35 +03:30
parent afc5c5be5c
commit 42f7b2f08b
3 changed files with 50 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/loading/logic.dart';
class LoadingWidget extends StatelessWidget {
LoadingWidget({super.key});
final controller = Get.put(LoadingWidgetLogic());
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 16.h,
children: [
Center(
child: Assets.anim.loading.lottie(width: 120.w, height: 120.h),
),
FadeTransition(
opacity: controller.textAnimation,
child: Text(
'در حال بارگذاری ...',
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
),
],
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:get/get.dart';
import 'package:flutter/material.dart';
class LoadingWidgetLogic extends GetxController with GetTickerProviderStateMixin {
late AnimationController _textAnimationController;
late Animation<double> textAnimation;
@override
void onInit() {
super.onInit();
_textAnimationController =
AnimationController(vsync: this, duration: const Duration(milliseconds: 1200))
..repeat(reverse: true);
textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut);
}
}

View File

@@ -1,14 +0,0 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class LoadingWidget extends StatelessWidget {
const LoadingWidget({super.key});
@override
Widget build(BuildContext context) {
return Center(child: Assets.anim.loading.lottie(
width: 120.w,
height: 120.h,
));
}
}