diff --git a/assets/icons/cow.svg b/assets/icons/cow.svg new file mode 100644 index 0000000..ad8320d --- /dev/null +++ b/assets/icons/cow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/vec/cow.svg.vec b/assets/vec/cow.svg.vec new file mode 100644 index 0000000..a459c94 Binary files /dev/null and b/assets/vec/cow.svg.vec differ diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart index bb2586b..eba3191 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart index d439b53..6b44fa7 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart index 7b85d9b..f69365d 100644 --- a/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart @@ -9,7 +9,7 @@ import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_f import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/profile/view.dart b/packages/chicken/lib/presentation/pages/profile/view.dart index 78baaa6..41451ad 100644 --- a/packages/chicken/lib/presentation/pages/profile/view.dart +++ b/packages/chicken/lib/presentation/pages/profile/view.dart @@ -6,7 +6,7 @@ import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart import 'package:rasadyar_auth/presentation/routes/pages.dart'; import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart index 7b5afb6..3a00c17 100644 --- a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -7,7 +7,6 @@ import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; import 'package:rasadyar_core/core.dart'; diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart index 8ee11f9..452576e 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart @@ -10,7 +10,6 @@ import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; import 'package:rasadyar_core/core.dart'; diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart index e04807c..fad7bc9 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart @@ -4,7 +4,7 @@ import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buy import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; import 'package:rasadyar_core/core.dart'; diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart index 6ea37ba..018d19a 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart @@ -6,7 +6,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/segmentation/view.dart b/packages/chicken/lib/presentation/pages/segmentation/view.dart index b3b898d..31e3519 100644 --- a/packages/chicken/lib/presentation/pages/segmentation/view.dart +++ b/packages/chicken/lib/presentation/pages/segmentation/view.dart @@ -6,7 +6,7 @@ import 'package:rasadyar_chicken/data/models/response/segmentation_model/segment import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; -import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; + import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/core/lib/presentation/common/assets.gen.dart b/packages/core/lib/presentation/common/assets.gen.dart index 44a3854..9ea23c7 100644 --- a/packages/core/lib/presentation/common/assets.gen.dart +++ b/packages/core/lib/presentation/common/assets.gen.dart @@ -88,6 +88,9 @@ class $AssetsIconsGen { /// File path: assets/icons/convert_cube.svg SvgGenImage get convertCube => const SvgGenImage('assets/icons/convert_cube.svg'); + /// File path: assets/icons/cow.svg + SvgGenImage get cow => const SvgGenImage('assets/icons/cow.svg'); + /// File path: assets/icons/cube.svg SvgGenImage get cube => const SvgGenImage('assets/icons/cube.svg'); @@ -280,6 +283,7 @@ class $AssetsIconsGen { closeCircle, closeSquare, convertCube, + cow, cube, cubeBottomRotation, cubeRotate, @@ -429,6 +433,9 @@ class $AssetsVecGen { /// File path: assets/vec/convert_cube.svg.vec SvgGenImage get convertCubeSvg => const SvgGenImage.vec('assets/vec/convert_cube.svg.vec'); + /// File path: assets/vec/cow.svg.vec + SvgGenImage get cowSvg => const SvgGenImage.vec('assets/vec/cow.svg.vec'); + /// File path: assets/vec/cube.svg.vec SvgGenImage get cubeSvg => const SvgGenImage.vec('assets/vec/cube.svg.vec'); @@ -621,6 +628,7 @@ class $AssetsVecGen { closeCircleSvg, closeSquareSvg, convertCubeSvg, + cowSvg, cubeSvg, cubeBottomRotationSvg, cubeRotateSvg, diff --git a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart index 7d921b7..55fb489 100644 --- a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart +++ b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart @@ -51,7 +51,7 @@ class BaseBottomSheet extends StatelessWidget { ], ), ), - SizedBox(height: 2), + SizedBox(height:8), Expanded(child: SingleChildScrollView(child: child)), ], ), diff --git a/packages/core/lib/presentation/widget/buttons/elevated.dart b/packages/core/lib/presentation/widget/buttons/elevated.dart index 01f9743..592254b 100644 --- a/packages/core/lib/presentation/widget/buttons/elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/elevated.dart @@ -5,7 +5,7 @@ import 'package:rasadyar_core/presentation/common/app_fonts.dart'; class RElevated extends StatelessWidget { const RElevated({ super.key, - required this.text, + this.text, required this.onPressed, this.foregroundColor = Colors.white, this.backgroundColor = AppColor.blueNormal, @@ -17,9 +17,11 @@ class RElevated extends StatelessWidget { this.height = 56.0, this.isFullWidth = false, this.isLoading = false, - }); + this.child, + }) : assert(text != null || child != null, 'Either text or child must be provided'); - final String text; + final String? text; + final Widget? child; final VoidCallback? onPressed; final double width; final double height; @@ -41,27 +43,23 @@ class RElevated extends StatelessWidget { style: ElevatedButton.styleFrom( backgroundColor: backgroundColor, foregroundColor: foregroundColor, - disabledBackgroundColor: - disabledBackgroundColor ?? backgroundColor.withAlpha(38), + disabledBackgroundColor: disabledBackgroundColor ?? backgroundColor.withAlpha(38), disabledForegroundColor: disabledForegroundColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(radius), - ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius)), minimumSize: Size(isFullWidth ? double.infinity : width, height), padding: EdgeInsets.zero, textStyle: textStyle ?? AppFonts.yekan18, ), - child: - isLoading - ? SizedBox( - width: 24, - height: 24, - child: CircularProgressIndicator( - strokeWidth: 2.5, - valueColor: AlwaysStoppedAnimation(foregroundColor), - ), - ) - : Text(text), + child: isLoading + ? SizedBox( + width: 24, + height: 24, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : child ?? Text(text!), ); } } diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart index 92a109d..4d1e629 100644 --- a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart @@ -16,7 +16,7 @@ class ROutlinedElevated extends StatefulWidget { this.child, this.width, this.height, - }); + }):assert(text!=null || child != null, 'Either text or child must be provided'); final String? text; final VoidCallback? onPressed; @@ -120,7 +120,7 @@ class _ROutlinedElevatedState extends State { return widget.textStyle ?? AppFonts.yekan20.copyWith(color: AppColor.blueNormal); }), ), - child: Text(widget.text ?? ''), + child: widget.child ?? Text(widget.text ?? ''), ), ); } diff --git a/packages/chicken/lib/presentation/widget/list_row_item.dart b/packages/core/lib/presentation/widget/list_row_item.dart similarity index 100% rename from packages/chicken/lib/presentation/widget/list_row_item.dart rename to packages/core/lib/presentation/widget/list_row_item.dart diff --git a/packages/core/lib/presentation/widget/widget.dart b/packages/core/lib/presentation/widget/widget.dart index 43077b5..dd55bb0 100644 --- a/packages/core/lib/presentation/widget/widget.dart +++ b/packages/core/lib/presentation/widget/widget.dart @@ -21,5 +21,6 @@ export 'tabs/new_tab.dart'; export 'tabs/r_segment.dart'; export 'tabs/tab.dart'; export 'vec_widget.dart'; +export 'list_row_item.dart'; //inputs export 'inputs/inputs.dart'; diff --git a/packages/inspection/lib/presentation/inspection_map/logic.dart b/packages/inspection/lib/presentation/inspection_map/logic.dart index fdd97c7..944784c 100644 --- a/packages/inspection/lib/presentation/inspection_map/logic.dart +++ b/packages/inspection/lib/presentation/inspection_map/logic.dart @@ -17,6 +17,7 @@ class InspectionMapLogic extends GetxController with GetTickerProviderStateMixin RxList markers = [].obs; Timer? _debounceTimer; RxBool isLoading = false.obs; + RxBool isSelectedDetailsLocation = false.obs; RxInt filterIndex = 0.obs; RxInt showIndex = 0.obs; diff --git a/packages/inspection/lib/presentation/inspection_map/view.dart b/packages/inspection/lib/presentation/inspection_map/view.dart index f287f66..72d174c 100644 --- a/packages/inspection/lib/presentation/inspection_map/view.dart +++ b/packages/inspection/lib/presentation/inspection_map/view.dart @@ -56,7 +56,7 @@ class InspectionMapPage extends GetView { marker: e, onTap: () { Get.bottomSheet( - selectedLocationWidget( + selectedLocationWidget2( showHint: false, sliderController: controller.slidController.value, trigger: () {}, @@ -107,6 +107,196 @@ class InspectionMapPage extends GetView { ); }, controller.isLoading); } + + Widget selectedLocationWidget2({ + required bool showHint, + required SlidableController sliderController, + required VoidCallback trigger, + required VoidCallback toggle, + }) { + return ObxValue((data) { + return BaseBottomSheet( + height: data.value ? 450.h : 150.h, + child: ListItemWithOutCounter( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + 'گوشت و مرغ', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text( + '0 کیلوگرم', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + secondChild: Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داوود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ بازرسی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '1403/12/12', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'تلفن خریدار', + value: '0326598653', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'آخرین فعالیت', value: '1409/12/12'), + buildRow(title: 'موجودی', value: '5KG'), + buildRow(title: 'فروش رفته', value: '5KG'), + ], + ), + ), + Row( + children: [ + Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + spacing: 7, + children: [ + RElevated( + width: 40.h, + height: 38.h, + backgroundColor: AppColor.greenNormal, + child: Assets.vec.messageAddSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + onPressed: () {}, + ), + RElevated( + width: 150.w, + height: 40.h, + backgroundColor: AppColor.blueNormal, + onPressed: () { + /*controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + + });*/ + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: 8, + children: [ + Assets.vec.mapSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Text( + 'مسیریابی', + style: AppFonts.yekan14Bold.copyWith(color: Colors.white), + ), + ], + ), + ), + ROutlinedElevated( + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + // controller.denyAllocation(item.key ?? ''); + //await controller.deleteAllocation(item); + }, + onRefresh: () async {}, + ); + }, + borderColor: AppColor.bgIcon, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.securityTimeSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn), + ), + Text( + 'سوابق بازرسی', + style: AppFonts.yekan14Bold.copyWith(color: AppColor.bgIcon), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + ), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.cowSvg.path, + labelIconColor: AppColor.bgIcon, + onTap: () => data.value = !data.value, + selected: data.value, + ), + ); + }, controller.isSelectedDetailsLocation); + } } Marker markerWidget({required LatLng marker, required VoidCallback onTap}) { @@ -652,69 +842,3 @@ Widget selectedLocationWidget({ ), ); } - -Widget selectedLocationWidget2({ - required bool showHint, - required SlidableController sliderController, - required VoidCallback trigger, - required VoidCallback toggle, -}) { - if (showHint) { - trigger.call(); - } - return BaseBottomSheet( - height: 150.h, - child: ListItem( - index: 0, - child:Container( - height: 58, - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(width: 1, color: AppColor.blackLightHover), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Text( - 'داود خرم مهری پور', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - 'گوشت و مرغ', - style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), - ), - ], - ), - Column( - children: [ - Text( - 'باقی مانده', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - '0 کیلوگرم', - style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), - ), - ], - ), - Assets.vec.scanBarcodeSvg.svg(), - ], - ), - ) , - secondChild: Container( - height: 350.h, - color: Colors.redAccent, - ), - labelColor: Colors.blue, - labelIcon: Assets.vec.mapSvg.path, - onTap: () { - - }, - selected: true, - ), - ); -} diff --git a/packages/inspection/lib/presentation/widget/list_item/list_item.dart b/packages/inspection/lib/presentation/widget/list_item/list_item.dart index fd65df6..3b48ae2 100644 --- a/packages/inspection/lib/presentation/widget/list_item/list_item.dart +++ b/packages/inspection/lib/presentation/widget/list_item/list_item.dart @@ -126,6 +126,107 @@ class ListItem extends StatelessWidget { } } +class ListItemWithOutCounter extends StatelessWidget { + const ListItemWithOutCounter({ + super.key, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: AnimatedSize( + duration: Duration(milliseconds: 300), + child: Container( + width: Get.width - 30, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: AnimatedCrossFade( + alignment: Alignment.center, + firstChild: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + secondChild: Container( + padding: EdgeInsets.all(8), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + ), + Visibility( + visible: selected==false, + child: Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} + class ListItem2 extends StatelessWidget { const ListItem2({ super.key,