From 092902bfdc9155a2a394b9cc42bec8650f0846c2 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 18 May 2026 09:56:02 +0300 Subject: [PATCH] multi selection animation added. --- .../multiple_item_drop_down_menu.dart | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart b/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart index 77935325..e1b1ca70 100644 --- a/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart +++ b/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart @@ -183,26 +183,41 @@ class _MultipleItemDropDownMenuState AnimatedSize( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + child: AnimatedOpacity( + opacity: _selectedItem.contains(_selectedItem[index]) ? 1.0 : 0.0, + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + child: Theme( + data: Theme.of(context).copyWith( + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + ), + child: Chip( + backgroundColor: AppColor.backgroundTabBarColor(context), + side: BorderSide(color: AppColor.border2Color(context)), + label: Text(_selectedItem[index].name!), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)), + labelStyle: AppTextStyles.tinyFont2.copyWith( + color: AppColor.labelTextStyleColor(context), + ), + deleteIconColor: AppColor.icon2Color(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onDeleted: () { + setState(() { + _selectedItem.removeAt(index); + }); + widget.onSelect!(_selectedItem); + }, + ), ), ), - ], + ), + ), ).paddingOnly(top: 4), ], )