163 lines
5.0 KiB
Dart
163 lines
5.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:line_icons/line_icon.dart';
|
|
import 'package:line_icons/line_icons.dart';
|
|
|
|
import '../../../../../../common/theme/theme.dart';
|
|
import '../../../../common/extension/extension.dart';
|
|
import '../../../../domain/user/user.dart';
|
|
import '../../../components/spacer/spacer.dart';
|
|
|
|
class HomeOmsetBalance extends StatelessWidget {
|
|
final int totalOmset;
|
|
final User user;
|
|
const HomeOmsetBalance({super.key, required this.totalOmset, required this.user});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: const EdgeInsets.symmetric(horizontal: 8),
|
|
clipBehavior: Clip.none,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(color: AppColor.white.withOpacity(0.3), width: 1),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: AppColor.white.withOpacity(0.1),
|
|
offset: const Offset(0, 2),
|
|
),
|
|
],
|
|
),
|
|
child: Column(
|
|
children: [_top(context), _middle(context), _bottom(context)],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _bottom(BuildContext context) {
|
|
return GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTap: () {
|
|
// context.router.push(BillingHistoryRoute());
|
|
},
|
|
child: Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
|
decoration: BoxDecoration(
|
|
color: AppColor.white.withOpacity(0.2),
|
|
borderRadius: BorderRadius.vertical(
|
|
bottom: Radius.circular(16),
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
LineIcon(LineIcons.calendar, color: AppColor.white, size: 14),
|
|
SpaceWidth(6),
|
|
Expanded(
|
|
child: IgnorePointer(
|
|
child: Text(
|
|
DateTime.now().toDate,
|
|
style: AppStyle.sm.copyWith(
|
|
color: AppColor.white,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0.3,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Container _middle(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
|
decoration: BoxDecoration(color: AppColor.white.withOpacity(0.3)),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: GestureDetector(
|
|
onTap: () {},
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
context.lang.sales_today,
|
|
style: AppStyle.sm.copyWith(
|
|
color: AppColor.white,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0.3,
|
|
),
|
|
),
|
|
SpaceHeight(2),
|
|
Text(
|
|
totalOmset.currencyFormatRp,
|
|
style: AppStyle.xl.copyWith(
|
|
color: AppColor.white,
|
|
fontWeight: FontWeight.w900,
|
|
letterSpacing: 0.3,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
LineIcon(LineIcons.eye, color: AppColor.white, size: 16),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
GestureDetector _top(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () {},
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
|
decoration: BoxDecoration(
|
|
color: AppColor.white.withOpacity(0.2),
|
|
borderRadius: BorderRadius.vertical(
|
|
top: Radius.circular(16),
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'Enaklo Bakso Bakmi 343',
|
|
style: AppStyle.sm.copyWith(
|
|
color: AppColor.white,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0.3,
|
|
),
|
|
),
|
|
SpaceHeight(2),
|
|
Text(
|
|
'Jl. Tawes No.53, Rawamangun, Kec. Pulo Gadung',
|
|
style: AppStyle.sm.copyWith(
|
|
color: AppColor.white,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0.3,
|
|
),
|
|
overflow: TextOverflow.ellipsis,
|
|
maxLines: 1,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SpaceWidth(6),
|
|
LineIcon(
|
|
LineIcons.alternateExchange,
|
|
color: AppColor.white,
|
|
size: 14,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |