import 'package:flutter/material.dart'; import '../../../../common/theme/theme.dart'; class FinanceAppbar extends StatelessWidget { const FinanceAppbar({ super.key, required this.rotationAnimation, required this.floatingAnimation, }); final Animation rotationAnimation; final Animation floatingAnimation; @override Widget build(BuildContext context) { return FlexibleSpaceBar( titlePadding: const EdgeInsets.only(left: 50, bottom: 16), title: Text( 'Keuangan', style: AppStyle.xl.copyWith( color: AppColor.textWhite, fontSize: 18, fontWeight: FontWeight.w600, ), ), background: Container( decoration: const BoxDecoration( gradient: LinearGradient( colors: AppColor.primaryGradient, begin: Alignment.topCenter, end: Alignment.bottomCenter, ), ), child: Stack( children: [ // Animated geometric shapes Positioned( right: -20, top: -20, child: AnimatedBuilder( animation: Listenable.merge([ rotationAnimation, floatingAnimation, ]), builder: (context, child) { return Transform.translate( offset: Offset( floatingAnimation.value * 10, floatingAnimation.value * 15, ), child: Transform.rotate( angle: rotationAnimation.value * 2 * 3.14159, child: Container( width: 120, height: 120, decoration: BoxDecoration( shape: BoxShape.circle, gradient: RadialGradient( colors: [ AppColor.white.withOpacity(0.15), AppColor.white.withOpacity(0.05), ], ), boxShadow: [ BoxShadow( color: AppColor.white.withOpacity(0.1), blurRadius: 20, spreadRadius: 5, ), ], ), ), ), ); }, ), ), Positioned( left: -30, bottom: -30, child: AnimatedBuilder( animation: Listenable.merge([ rotationAnimation, floatingAnimation, ]), builder: (context, child) { return Transform.translate( offset: Offset( -floatingAnimation.value * 8, -floatingAnimation.value * 12, ), child: Transform.rotate( angle: -rotationAnimation.value * 0.5 * 3.14159, child: Container( width: 100, height: 100, decoration: BoxDecoration( shape: BoxShape.circle, gradient: RadialGradient( colors: [ AppColor.white.withOpacity(0.1), AppColor.white.withOpacity(0.02), ], ), ), ), ), ); }, ), ), Positioned( right: 80, bottom: 30, child: AnimatedBuilder( animation: Listenable.merge([ rotationAnimation, floatingAnimation, ]), builder: (context, child) { return Transform.translate( offset: Offset( floatingAnimation.value * 5, -floatingAnimation.value * 8, ), child: Transform.rotate( angle: -rotationAnimation.value * 0.3 * 3.14159, child: Container( width: 50, height: 50, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), gradient: LinearGradient( colors: [ AppColor.white.withOpacity(0.12), AppColor.white.withOpacity(0.04), ], begin: Alignment.topLeft, end: Alignment.bottomRight, ), ), ), ), ); }, ), ), // Additional floating elements Positioned( left: 60, top: 80, child: AnimatedBuilder( animation: floatingAnimation, builder: (context, child) { return Transform.translate( offset: Offset( floatingAnimation.value * 3, floatingAnimation.value * 6, ), child: Container( width: 30, height: 30, decoration: BoxDecoration( shape: BoxShape.circle, color: AppColor.white.withOpacity(0.08), ), ), ); }, ), ), Positioned( right: 40, top: 120, child: AnimatedBuilder( animation: floatingAnimation, builder: (context, child) { return Transform.translate( offset: Offset( -floatingAnimation.value * 4, floatingAnimation.value * 7, ), child: Container( width: 20, height: 20, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: AppColor.white.withOpacity(0.06), ), ), ); }, ), ), ], ), ), ); } }