From a9e1390a4a1a37ebf961020f7c63cd2abc638f47 Mon Sep 17 00:00:00 2001 From: orangdeso Date: Wed, 14 May 2025 15:33:25 +0700 Subject: [PATCH] Feat: done data statistic for home porter --- .dart_tool/package_config.json | 2 +- assets/icons/ic_income_filled.svg | 3 ++ assets/icons/ic_order_complete_filled.svg | 3 ++ assets/icons/ic_order_filled.svg | 3 ++ assets/icons/ic_order_history_filled.svg | 10 ++++ lib/_core/component/icons/icons_library.dart | 6 +++ .../screens/home/component/summary_card.dart | 49 +++++++++++-------- .../screens/home/pages/home_screen.dart | 32 ++++++------ 8 files changed, 70 insertions(+), 38 deletions(-) create mode 100644 assets/icons/ic_income_filled.svg create mode 100644 assets/icons/ic_order_complete_filled.svg create mode 100644 assets/icons/ic_order_filled.svg create mode 100644 assets/icons/ic_order_history_filled.svg diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 3f4520a..36826ab 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -680,7 +680,7 @@ "languageVersion": "3.4" } ], - "generated": "2025-05-14T06:38:43.763178Z", + "generated": "2025-05-14T07:20:56.034581Z", "generator": "pub", "generatorVersion": "3.5.0", "flutterRoot": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0", diff --git a/assets/icons/ic_income_filled.svg b/assets/icons/ic_income_filled.svg new file mode 100644 index 0000000..ee8b38e --- /dev/null +++ b/assets/icons/ic_income_filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/ic_order_complete_filled.svg b/assets/icons/ic_order_complete_filled.svg new file mode 100644 index 0000000..3428637 --- /dev/null +++ b/assets/icons/ic_order_complete_filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/ic_order_filled.svg b/assets/icons/ic_order_filled.svg new file mode 100644 index 0000000..4e9bc34 --- /dev/null +++ b/assets/icons/ic_order_filled.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/ic_order_history_filled.svg b/assets/icons/ic_order_history_filled.svg new file mode 100644 index 0000000..02a21f2 --- /dev/null +++ b/assets/icons/ic_order_history_filled.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/_core/component/icons/icons_library.dart b/lib/_core/component/icons/icons_library.dart index b0110e5..4fb0a09 100644 --- a/lib/_core/component/icons/icons_library.dart +++ b/lib/_core/component/icons/icons_library.dart @@ -22,6 +22,7 @@ class CustomeIcons { ); } + // Icons Outlined static SvgPicture AccountOutline({double? size, Color? color}) => getIcon('ic_account', color: color); static SvgPicture CalendarOutline({double? size, Color? color}) => getIcon('ic_calendar', color: color); static SvgPicture DataTransferOutline({double? size, Color? color}) => getIcon('ic_data_transfer', color: color); @@ -55,8 +56,13 @@ class CustomeIcons { static SvgPicture ScrollOutline({double? size, Color? color}) => getIcon('ic_scroll_outline', color: color); static SvgPicture PhoneOutline({double? size, Color? color}) => getIcon('ic_phone', color: color); + // Icons Filled static SvgPicture ScrollFilled({double? size, Color? color}) => getIcon('ic_scroll_filled', color: color); static SvgPicture FlightSeatFilled({double? size, Color? color}) => getIcon('ic_flight_seat_filled', color: color); static SvgPicture PlaneRightFilled({double? size, Color? color}) => getIcon('ic_plane_filled', color: color); static SvgPicture VIPFilled({double? size, Color? color}) => getIcon('ic_vip', color: color); + static SvgPicture IncomeFilled({double? size, Color? color}) => getIcon('ic_income_filled', color: color); + static SvgPicture OrderFilled({double? size, Color? color}) => getIcon('ic_order_filled', color: color); + static SvgPicture OrderHistoryFilled({double? size, Color? color}) => getIcon('ic_order_history_filled', color: color); + static SvgPicture OrderCompleteFilled({double? size, Color? color}) => getIcon('ic_order_complete_filled', color: color); } diff --git a/lib/presentation/screens/home/component/summary_card.dart b/lib/presentation/screens/home/component/summary_card.dart index e2275ec..581c65b 100644 --- a/lib/presentation/screens/home/component/summary_card.dart +++ b/lib/presentation/screens/home/component/summary_card.dart @@ -23,28 +23,35 @@ class SummaryCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - icon, - SizedBox(width: 16.w), - Expanded( - child: TypographyStyles.caption( - label, - color: GrayColors.gray600, - fontWeight: FontWeight.w600, - overflow: TextOverflow.ellipsis, - maxlines: 1, - ), - ), - ], + Container( + padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h), + decoration: BoxDecoration( + color: PrimaryColors.primary50, + borderRadius: BorderRadius.circular(8.r), + ), + child: icon, + ), + SizedBox(height: 12.h), + Padding( + padding: EdgeInsets.only(left: 8.w), + child: TypographyStyles.h6( + value, + color: GrayColors.gray800, + overflow: TextOverflow.ellipsis, + maxlines: 1, + ), + ), + SizedBox(height: 12.h), + Padding( + padding: EdgeInsets.only(left: 8.w), + child: TypographyStyles.caption( + label, + fontWeight: FontWeight.w400, + color: GrayColors.gray500, + overflow: TextOverflow.ellipsis, + maxlines: 2, + ), ), - SizedBox(height: 10.h), - TypographyStyles.body( - value, - color: GrayColors.gray800, - overflow: TextOverflow.ellipsis, - maxlines: 1, - ) ], ), ), diff --git a/lib/presentation/screens/home/pages/home_screen.dart b/lib/presentation/screens/home/pages/home_screen.dart index f28cb73..4330f23 100644 --- a/lib/presentation/screens/home/pages/home_screen.dart +++ b/lib/presentation/screens/home/pages/home_screen.dart @@ -398,17 +398,17 @@ class _HomeScreenState extends State { children: [ Obx( () => SummaryCard( - label: 'Pesanan Masuk', + label: 'Daftar pesanan masuk anda', value: '${_statisticController.incoming.value}', - icon: CustomeIcons.PlaneLeftOutline(), + icon: CustomeIcons.OrderFilled(), ), ), SizedBox(width: 16.w), Obx( () => SummaryCard( - label: 'Pesanan Diproses', + label: 'Daftar pesanan status diproses', value: '${_statisticController.inProgress.value}', - icon: CustomeIcons.PlaneLeftOutline(), + icon: CustomeIcons.OrderHistoryFilled(), ), ) ], @@ -418,9 +418,9 @@ class _HomeScreenState extends State { children: [ Obx( () => SummaryCard( - label: 'Pesanan Selesai', - value: 'Rp ${_statisticController.completed.value}', - icon: CustomeIcons.PlaneLeftOutline(), + label: 'Daftar pesanan status selesai', + value: '${_statisticController.completed.value}', + icon: CustomeIcons.OrderCompleteFilled(), ), ), SizedBox(width: 16.w), @@ -431,9 +431,9 @@ class _HomeScreenState extends State { NumberFormat.currency(locale: 'id_ID', symbol: 'Rp ', decimalDigits: 0) .format(revenue); return SummaryCard( - label: 'Pendapatan', + label: 'Jumlah pendapatan anda hari ini', value: formatted, - icon: CustomeIcons.PlaneLeftOutline(), + icon: CustomeIcons.IncomeFilled(), ); }, ), @@ -637,7 +637,7 @@ class _HomeScreenState extends State { required String nameAvatar, required String nameUser, required String subTitle, - VoidCallback? onTap, + // VoidCallback? onTap, }) { return CustomeShadowCotainner( sizeRadius: 0.r, @@ -659,12 +659,12 @@ class _HomeScreenState extends State { ], ), ), - ZoomTapAnimation( - child: IconButton( - onPressed: onTap, - icon: CustomeIcons.NotificationOutline(), - ), - ) + // ZoomTapAnimation( + // child: IconButton( + // onPressed: onTap, + // icon: CustomeIcons.NotificationOutline(), + // ), + // ) ], ), );