animation added on dashboard all work order text section

main_production_RSG
Sikander Saleem 1 month ago
parent 84e36c9d70
commit 6be571c6a9

@ -25,6 +25,8 @@ class RequestCategoryFragment extends StatefulWidget {
class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with SingleTickerProviderStateMixin {
bool isAscending = false;
late AnimationController _animationController;
late Animation<double> _headerFadeAnimation;
late Animation<Offset> _headerSlideAnimation;
@override
void initState() {
@ -33,6 +35,25 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
duration: const Duration(milliseconds: 1200),
vsync: this,
);
// Header animation (appears first, faster)
_headerFadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: const Interval(0.0, 0.4, curve: Curves.easeOut),
),
);
_headerSlideAnimation = Tween<Offset>(
begin: const Offset(0.0, -0.3),
end: Offset.zero,
).animate(
CurvedAnimation(
parent: _animationController,
curve: const Interval(0.0, 0.5, curve: Curves.easeOutCubic),
),
);
_animationController.forward();
}
@ -77,46 +98,52 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
context: context,
userType: Provider.of<UserProvider>(context, listen: false).user?.type,
),
!isNurse && dashboardProvider.tabs.isNotEmpty && dashboardProvider.tabs[dashboardProvider.currentListIndex].tag == 0
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// context.translation.allWorkOrder.heading4(context),
// GestureDetector(
// onTap: () {
// dashboardProvider.isShowDashBoardCalendar = !dashboardProvider.isShowDashBoardCalendar;
// },
// child: dashboardProvider.isShowDashBoardCalendar ? AppAsset.listIcon.toSvgAsset() : AppAsset.calendarIcon.toSvgAsset())
// ],
// ),
dashboardProvider.isShowDashBoardCalendar
? Padding(
padding: EdgeInsets.only(top: 12.toScreenHeight),
child: const WeeklyCalendarFragment(),
)
: const SizedBox(),
],
).paddingOnly(start: 14, end: 12)
: Row(
spacing: 16,
children: [
Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))).expanded,
if (!isFMSEngineer)
'search'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {
Navigator.of(context).pushNamed('/cleaner_search');
}),
Transform.flip(
flipY: isAscending,
child: 'dashboard/sort_descending'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {
_toggleSort(dashboardProvider, user?.type);
}),
)
],
).paddingOnly(start: 16, end: 16),
FadeTransition(
opacity: _headerFadeAnimation,
child: SlideTransition(
position: _headerSlideAnimation,
child: !isNurse && dashboardProvider.tabs.isNotEmpty && dashboardProvider.tabs[dashboardProvider.currentListIndex].tag == 0
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// context.translation.allWorkOrder.heading4(context),
// GestureDetector(
// onTap: () {
// dashboardProvider.isShowDashBoardCalendar = !dashboardProvider.isShowDashBoardCalendar;
// },
// child: dashboardProvider.isShowDashBoardCalendar ? AppAsset.listIcon.toSvgAsset() : AppAsset.calendarIcon.toSvgAsset())
// ],
// ),
dashboardProvider.isShowDashBoardCalendar
? Padding(
padding: EdgeInsets.only(top: 12.toScreenHeight),
child: const WeeklyCalendarFragment(),
)
: const SizedBox(),
],
).paddingOnly(start: 14, end: 12)
: Row(
spacing: 16,
children: [
Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))).expanded,
if (!isFMSEngineer)
'search'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {
Navigator.of(context).pushNamed('/cleaner_search');
}),
Transform.flip(
flipY: isAscending,
child: 'dashboard/sort_descending'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {
_toggleSort(dashboardProvider, user?.type);
}),
)
],
).paddingOnly(start: 16, end: 16),
),
),
// isFMSEngineer
// ? Row(

Loading…
Cancel
Save