162 lines
5.3 KiB
Dart
162 lines
5.3 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import '../../../../common/theme/theme.dart';
|
||
|
|
import '../../../components/spacer/spacer.dart';
|
||
|
|
|
||
|
|
class ReportRevenueSummary extends StatelessWidget {
|
||
|
|
final Animation<double> rotationAnimation;
|
||
|
|
const ReportRevenueSummary({super.key, required this.rotationAnimation});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Container(
|
||
|
|
height: 180,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
borderRadius: BorderRadius.circular(24),
|
||
|
|
boxShadow: [
|
||
|
|
BoxShadow(
|
||
|
|
color: AppColor.primary.withOpacity(0.3),
|
||
|
|
blurRadius: 20,
|
||
|
|
offset: const Offset(0, 8),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
child: Stack(
|
||
|
|
children: [
|
||
|
|
Container(
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
gradient: const LinearGradient(
|
||
|
|
colors: AppColor.primaryGradient,
|
||
|
|
begin: Alignment.topLeft,
|
||
|
|
end: Alignment.bottomRight,
|
||
|
|
),
|
||
|
|
borderRadius: BorderRadius.circular(24),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
// Floating elements
|
||
|
|
Positioned(
|
||
|
|
right: 20,
|
||
|
|
top: 20,
|
||
|
|
child: AnimatedBuilder(
|
||
|
|
animation: rotationAnimation,
|
||
|
|
builder: (context, child) {
|
||
|
|
return Transform.rotate(
|
||
|
|
angle: rotationAnimation.value * 0.3,
|
||
|
|
child: Container(
|
||
|
|
width: 60,
|
||
|
|
height: 60,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
shape: BoxShape.circle,
|
||
|
|
color: AppColor.white.withOpacity(0.1),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
},
|
||
|
|
),
|
||
|
|
),
|
||
|
|
Positioned(
|
||
|
|
right: 60,
|
||
|
|
bottom: 30,
|
||
|
|
child: AnimatedBuilder(
|
||
|
|
animation: rotationAnimation,
|
||
|
|
builder: (context, child) {
|
||
|
|
return Transform.rotate(
|
||
|
|
angle: -rotationAnimation.value * 0.2,
|
||
|
|
child: Container(
|
||
|
|
width: 40,
|
||
|
|
height: 40,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
borderRadius: BorderRadius.circular(8),
|
||
|
|
color: AppColor.white.withOpacity(0.08),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
},
|
||
|
|
),
|
||
|
|
),
|
||
|
|
// Content
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.all(24),
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
Container(
|
||
|
|
padding: const EdgeInsets.all(8),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: AppColor.white.withOpacity(0.2),
|
||
|
|
borderRadius: BorderRadius.circular(10),
|
||
|
|
),
|
||
|
|
child: const Icon(
|
||
|
|
Icons.account_balance_wallet,
|
||
|
|
color: AppColor.textWhite,
|
||
|
|
size: 20,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SpaceWidth(12),
|
||
|
|
Text(
|
||
|
|
'Total Pendapatan',
|
||
|
|
style: AppStyle.lg.copyWith(
|
||
|
|
color: AppColor.textWhite,
|
||
|
|
fontWeight: FontWeight.w500,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
const Spacer(),
|
||
|
|
Text(
|
||
|
|
'Rp 15.450.000',
|
||
|
|
style: AppStyle.h1.copyWith(
|
||
|
|
color: AppColor.textWhite,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
letterSpacing: -1,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SpaceHeight(8),
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
Container(
|
||
|
|
padding: const EdgeInsets.symmetric(
|
||
|
|
horizontal: 12,
|
||
|
|
vertical: 6,
|
||
|
|
),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: AppColor.success.withOpacity(0.9),
|
||
|
|
borderRadius: BorderRadius.circular(20),
|
||
|
|
),
|
||
|
|
child: Row(
|
||
|
|
mainAxisSize: MainAxisSize.min,
|
||
|
|
children: [
|
||
|
|
Icon(
|
||
|
|
Icons.trending_up,
|
||
|
|
color: AppColor.textWhite,
|
||
|
|
size: 16,
|
||
|
|
),
|
||
|
|
SpaceWidth(4),
|
||
|
|
Text(
|
||
|
|
'+12.5%',
|
||
|
|
style: AppStyle.sm.copyWith(
|
||
|
|
color: AppColor.textWhite,
|
||
|
|
fontWeight: FontWeight.w700,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SpaceWidth(12),
|
||
|
|
Text(
|
||
|
|
'dari periode sebelumnya',
|
||
|
|
style: AppStyle.sm.copyWith(color: AppColor.textWhite),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|