update outlet card
This commit is contained in:
parent
6e4b09f15e
commit
c2727a0995
@ -1,6 +1,5 @@
|
|||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:line_icons/line_icons.dart';
|
|
||||||
|
|
||||||
import '../../../../common/extension/extension.dart';
|
import '../../../../common/extension/extension.dart';
|
||||||
import '../../../../common/theme/theme.dart';
|
import '../../../../common/theme/theme.dart';
|
||||||
|
|||||||
@ -145,7 +145,7 @@ class _HomeOmsetBalanceState extends State<HomeOmsetBalance> {
|
|||||||
? Text(
|
? Text(
|
||||||
widget.totalOmset.currencyFormatRp,
|
widget.totalOmset.currencyFormatRp,
|
||||||
key: const ValueKey('visible'),
|
key: const ValueKey('visible'),
|
||||||
style: AppStyle.xl.copyWith(
|
style: AppStyle.xxl.copyWith(
|
||||||
color: AppColor.black,
|
color: AppColor.black,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
letterSpacing: 0.3,
|
letterSpacing: 0.3,
|
||||||
|
|||||||
@ -8,8 +8,8 @@ class HomePromoBanner extends StatelessWidget {
|
|||||||
const HomePromoBanner({super.key});
|
const HomePromoBanner({super.key});
|
||||||
|
|
||||||
static const _outlets = [
|
static const _outlets = [
|
||||||
'ENAKLO RAWAMANGUNG',
|
{'name': 'ENAKLO RAWAMANGUNG', 'isHealthy': true},
|
||||||
'ENAKLO WOKU PEDAS\nKELAPA GADING',
|
{'name': 'ENAKLO WOKU PEDAS\nKELAPA GADING', 'isHealthy': true},
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -26,7 +26,7 @@ class HomePromoBanner extends StatelessWidget {
|
|||||||
for (int i = 0; i < _outlets.length; i++) ...[
|
for (int i = 0; i < _outlets.length; i++) ...[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ParticleCard(
|
child: ParticleCard(
|
||||||
height: 100,
|
height: 110,
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 12,
|
horizontal: 12,
|
||||||
vertical: 12,
|
vertical: 12,
|
||||||
@ -36,28 +36,15 @@ class HomePromoBanner extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Row(
|
||||||
padding: const EdgeInsets.symmetric(
|
children: [
|
||||||
horizontal: 7,
|
Spacer(),
|
||||||
vertical: 2,
|
_buildHealthIndicator(_outlets[i]['isHealthy'] as bool),
|
||||||
),
|
],
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.white.withOpacity(0.2),
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'OUTLET',
|
|
||||||
style: AppStyle.xs.copyWith(
|
|
||||||
color: AppColor.white,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
letterSpacing: 1.0,
|
|
||||||
fontSize: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SpaceHeight(6),
|
const SpaceHeight(6),
|
||||||
Text(
|
Text(
|
||||||
_outlets[i],
|
_outlets[i]['name'] as String,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
@ -76,4 +63,43 @@ class HomePromoBanner extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildHealthIndicator(bool isHealthy) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isHealthy
|
||||||
|
? AppColor.success.withOpacity(0.9)
|
||||||
|
: AppColor.error.withOpacity(0.9),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: (isHealthy ? AppColor.success : AppColor.error)
|
||||||
|
.withOpacity(0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
isHealthy ? Icons.check_circle : Icons.warning_rounded,
|
||||||
|
color: AppColor.white,
|
||||||
|
size: 12,
|
||||||
|
),
|
||||||
|
const SpaceWidth(4),
|
||||||
|
Text(
|
||||||
|
isHealthy ? 'Sehat' : 'Tidak Sehat',
|
||||||
|
style: AppStyle.xs.copyWith(
|
||||||
|
color: AppColor.white,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 9,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user