diff --git a/packages/core/lib/presentation/widget/loading/loading_widget.dart b/packages/core/lib/presentation/widget/loading/loading_widget.dart new file mode 100644 index 0000000..8052370 --- /dev/null +++ b/packages/core/lib/presentation/widget/loading/loading_widget.dart @@ -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), + ), + ), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/loading/logic.dart b/packages/core/lib/presentation/widget/loading/logic.dart new file mode 100644 index 0000000..447a458 --- /dev/null +++ b/packages/core/lib/presentation/widget/loading/logic.dart @@ -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 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); + } + + + +} diff --git a/packages/core/lib/presentation/widget/loading_widget.dart b/packages/core/lib/presentation/widget/loading_widget.dart deleted file mode 100644 index 98f4671..0000000 --- a/packages/core/lib/presentation/widget/loading_widget.dart +++ /dev/null @@ -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, - )); - } -}