feat: home ui update and update api url
Build & Deploy iOS to TestFlight / build-and-deploy (push) Has been cancelled
Build & Deploy iOS to TestFlight / build-and-deploy (push) Has been cancelled
This commit is contained in:
+2
-2
@@ -9,12 +9,12 @@ abstract class Env {
|
|||||||
@dev
|
@dev
|
||||||
class DevEnv implements Env {
|
class DevEnv implements Env {
|
||||||
@override
|
@override
|
||||||
String get baseUrl => 'https://api-pos.apskel.id'; // example value
|
String get baseUrl => 'https://enaklo-pos-api.altru.id'; // example value
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable(as: Env)
|
@Injectable(as: Env)
|
||||||
@prod
|
@prod
|
||||||
class ProdEnv implements Env {
|
class ProdEnv implements Env {
|
||||||
@override
|
@override
|
||||||
String get baseUrl => 'https://api-pos.apskel.id';
|
String get baseUrl => 'https://enaklo-pos-api.altru.id';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ class _HomeHeaderState extends State<HomeHeader>
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
AppColor.primary,
|
AppColor.primaryDark,
|
||||||
AppColor.primary.withOpacity(0.9),
|
AppColor.primaryDark.withOpacity(0.9),
|
||||||
AppColor.primaryLight.withOpacity(0.85),
|
AppColor.primaryLight.withOpacity(0.85),
|
||||||
],
|
],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
|
|||||||
@@ -17,8 +17,16 @@ class HeaderDateFilter extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white.withOpacity(0.15),
|
color: AppColor.primary.withOpacity(0.8),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: AppColor.white.withOpacity(0.3)),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.15),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 3),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -39,11 +47,22 @@ class HeaderDateFilter extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 220),
|
||||||
|
curve: Curves.easeOutCubic,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected ? AppColor.white : Colors.transparent,
|
color: isSelected ? AppColor.white : Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
boxShadow: isSelected
|
||||||
|
? [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.18),
|
||||||
|
blurRadius: 8,
|
||||||
|
spreadRadius: 0,
|
||||||
|
offset: const Offset(0, 3),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -18,9 +18,17 @@ class HeaderOutletSelector extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white.withOpacity(0.15),
|
color: AppColor.primary.withOpacity(0.8),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
border: Border.all(color: AppColor.white.withOpacity(0.3)),
|
border: Border.all(color: AppColor.white.withOpacity(0.3)),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.15),
|
||||||
|
blurRadius: 10,
|
||||||
|
spreadRadius: 0,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -34,85 +34,202 @@ class HeaderSummaryCard extends StatelessWidget {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white.withOpacity(0.15),
|
borderRadius: BorderRadius.circular(18),
|
||||||
borderRadius: BorderRadius.circular(16),
|
gradient: const LinearGradient(
|
||||||
border: Border.all(color: AppColor.white.withOpacity(0.2)),
|
colors: [
|
||||||
),
|
Color(0xFFE8000A), // sedikit lebih terang di atas
|
||||||
child: Column(
|
Color(0xFFC40202), // primary di tengah
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Color(0xFF990000), // gelap di bawah
|
||||||
children: [
|
],
|
||||||
// Top: Icon + Title + Percentage + Chevron
|
begin: Alignment.topLeft,
|
||||||
Row(
|
end: Alignment.bottomRight,
|
||||||
children: [
|
stops: [0.0, 0.5, 1.0],
|
||||||
Container(
|
),
|
||||||
padding: const EdgeInsets.all(8),
|
boxShadow: [
|
||||||
decoration: BoxDecoration(
|
// Shadow merah di bawah — efek floating/3D
|
||||||
color: iconColor,
|
BoxShadow(
|
||||||
borderRadius: BorderRadius.circular(10),
|
color: const Color(0xFFC40202).withOpacity(0.55),
|
||||||
),
|
blurRadius: 16,
|
||||||
child: Icon(icon, color: Colors.white, size: 20),
|
spreadRadius: 0,
|
||||||
),
|
offset: const Offset(0, 8),
|
||||||
const SpaceWidth(10),
|
|
||||||
Text(
|
|
||||||
title,
|
|
||||||
style: AppStyle.md.copyWith(
|
|
||||||
color: AppColor.white,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
if (percentage != null) _buildPercentageBadge(),
|
|
||||||
const SpaceWidth(6),
|
|
||||||
Icon(
|
|
||||||
Icons.chevron_right_rounded,
|
|
||||||
color: AppColor.white.withOpacity(0.7),
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
// Inner highlight di atas kiri (simulasi cahaya)
|
||||||
const SpaceHeight(12),
|
BoxShadow(
|
||||||
|
color: AppColor.white.withOpacity(0.08),
|
||||||
// Value (hidden or visible)
|
blurRadius: 0,
|
||||||
isValueVisible
|
spreadRadius: -1,
|
||||||
? Text(
|
offset: const Offset(0, 1),
|
||||||
value.currencyFormatRp,
|
|
||||||
style: AppStyle.h1.copyWith(
|
|
||||||
color: AppColor.white,
|
|
||||||
fontWeight: FontWeight.w900,
|
|
||||||
fontSize: 26,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Text(
|
|
||||||
'Rp ••••••',
|
|
||||||
style: AppStyle.h1.copyWith(
|
|
||||||
color: AppColor.white,
|
|
||||||
fontWeight: FontWeight.w900,
|
|
||||||
fontSize: 26,
|
|
||||||
letterSpacing: 2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
const SpaceHeight(4),
|
|
||||||
|
|
||||||
// Subtitle
|
|
||||||
Text(
|
|
||||||
subtitle,
|
|
||||||
style: AppStyle.xs.copyWith(
|
|
||||||
color: AppColor.white.withOpacity(0.7),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
const Spacer(),
|
|
||||||
|
|
||||||
// Mini bar chart
|
|
||||||
_buildMiniBarChart(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(18),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
// Top highlight strip — efek glossy
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Container(
|
||||||
|
height: 1.5,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
AppColor.white.withOpacity(0.0),
|
||||||
|
AppColor.white.withOpacity(0.35),
|
||||||
|
AppColor.white.withOpacity(0.0),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Decorative circles
|
||||||
|
Positioned(
|
||||||
|
top: -30,
|
||||||
|
right: -30,
|
||||||
|
child: Container(
|
||||||
|
width: 120,
|
||||||
|
height: 120,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: AppColor.white.withOpacity(0.07),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: -20,
|
||||||
|
right: 20,
|
||||||
|
child: Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: AppColor.white.withOpacity(0.05),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 40,
|
||||||
|
left: -20,
|
||||||
|
child: Container(
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: AppColor.white.withOpacity(0.04),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Content
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Top: Icon + Title + Percentage + Chevron
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
// Icon dengan shadow
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [iconColor.withOpacity(0.9), iconColor],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: iconColor.withOpacity(0.5),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Icon(icon, color: Colors.white, size: 20),
|
||||||
|
),
|
||||||
|
const SpaceWidth(10),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
color: AppColor.white,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
shadows: [
|
||||||
|
Shadow(
|
||||||
|
color: Colors.black.withOpacity(0.2),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
if (percentage != null) _buildPercentageBadge(),
|
||||||
|
const SpaceWidth(6),
|
||||||
|
Icon(
|
||||||
|
Icons.chevron_right_rounded,
|
||||||
|
color: AppColor.white.withOpacity(0.7),
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
const SpaceHeight(12),
|
||||||
|
|
||||||
|
// Value
|
||||||
|
isValueVisible
|
||||||
|
? Text(
|
||||||
|
value.currencyFormatRp,
|
||||||
|
style: AppStyle.h1.copyWith(
|
||||||
|
color: AppColor.white,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
fontSize: 26,
|
||||||
|
shadows: [
|
||||||
|
Shadow(
|
||||||
|
color: Colors.black.withOpacity(0.25),
|
||||||
|
blurRadius: 6,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'Rp ••••••',
|
||||||
|
style: AppStyle.h1.copyWith(
|
||||||
|
color: AppColor.white,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
fontSize: 26,
|
||||||
|
letterSpacing: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SpaceHeight(4),
|
||||||
|
|
||||||
|
// Subtitle
|
||||||
|
Text(
|
||||||
|
subtitle,
|
||||||
|
style: AppStyle.xs.copyWith(
|
||||||
|
color: AppColor.white.withOpacity(0.7),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const Spacer(),
|
||||||
|
|
||||||
|
// Mini bar chart
|
||||||
|
_buildMiniBarChart(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -126,6 +243,12 @@ class HeaderSummaryCard extends StatelessWidget {
|
|||||||
? const Color(0xFF4CAF50).withOpacity(0.25)
|
? const Color(0xFF4CAF50).withOpacity(0.25)
|
||||||
: const Color(0xFFE53E3E).withOpacity(0.25),
|
: const Color(0xFFE53E3E).withOpacity(0.25),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: isPositive
|
||||||
|
? const Color(0xFF4CAF50).withOpacity(0.4)
|
||||||
|
: const Color(0xFFE53E3E).withOpacity(0.4),
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -162,18 +285,31 @@ class HeaderSummaryCard extends StatelessWidget {
|
|||||||
.fold<int>(0, (a, b) => a > b ? a : b);
|
.fold<int>(0, (a, b) => a > b ? a : b);
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 24,
|
height: 28,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: dailyData.map((d) {
|
children: dailyData.map((d) {
|
||||||
final ratio = maxVal > 0 ? d.totalCost / maxVal : 0.0;
|
final ratio = maxVal > 0 ? d.totalCost / maxVal : 0.0;
|
||||||
|
final isMax = maxVal > 0 && d.totalCost == maxVal;
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 1.5),
|
margin: const EdgeInsets.symmetric(horizontal: 1.5),
|
||||||
height: 6 + (18 * ratio),
|
height: 6 + (22 * ratio),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white.withOpacity(0.4),
|
// Bar tertinggi lebih terang
|
||||||
|
color: isMax
|
||||||
|
? AppColor.white.withOpacity(0.75)
|
||||||
|
: AppColor.white.withOpacity(0.35),
|
||||||
borderRadius: BorderRadius.circular(3),
|
borderRadius: BorderRadius.circular(3),
|
||||||
|
boxShadow: isMax
|
||||||
|
? [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.white.withOpacity(0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, -2),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ description: "A new Flutter project."
|
|||||||
|
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 1.0.4+9
|
version: 1.0.4+10
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.8.1
|
sdk: ^3.8.1
|
||||||
|
|||||||
Reference in New Issue
Block a user