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 { class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with SingleTickerProviderStateMixin {
bool isAscending = false; bool isAscending = false;
late AnimationController _animationController; late AnimationController _animationController;
late Animation<double> _headerFadeAnimation;
late Animation<Offset> _headerSlideAnimation;
@override @override
void initState() { void initState() {
@ -33,6 +35,25 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
duration: const Duration(milliseconds: 1200), duration: const Duration(milliseconds: 1200),
vsync: this, 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(); _animationController.forward();
} }
@ -77,7 +98,11 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
context: context, context: context,
userType: Provider.of<UserProvider>(context, listen: false).user?.type, userType: Provider.of<UserProvider>(context, listen: false).user?.type,
), ),
!isNurse && dashboardProvider.tabs.isNotEmpty && dashboardProvider.tabs[dashboardProvider.currentListIndex].tag == 0 FadeTransition(
opacity: _headerFadeAnimation,
child: SlideTransition(
position: _headerSlideAnimation,
child: !isNurse && dashboardProvider.tabs.isNotEmpty && dashboardProvider.tabs[dashboardProvider.currentListIndex].tag == 0
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -117,6 +142,8 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
) )
], ],
).paddingOnly(start: 16, end: 16), ).paddingOnly(start: 16, end: 16),
),
),
// isFMSEngineer // isFMSEngineer
// ? Row( // ? Row(

Loading…
Cancel
Save