multi selection animation added.

main_production_RSG
Sikander Saleem 1 month ago
parent dc1cc6c174
commit 092902bfdc

@ -183,26 +183,41 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
Wrap( Wrap(
runSpacing: 4.toScreenHeight, runSpacing: 4.toScreenHeight,
spacing: 4.toScreenWidth, spacing: 4.toScreenWidth,
children: [ children: List.generate(
for (int i = 0; i < _selectedItem.length; i++) _selectedItem.length,
Theme( (index) => AnimatedSize(
data: Theme.of(context).copyWith(splashColor: Colors.transparent, highlightColor: Colors.transparent), 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( child: Chip(
backgroundColor: AppColor.backgroundTabBarColor(context), backgroundColor: AppColor.backgroundTabBarColor(context),
side: BorderSide(color: AppColor.border2Color(context)), side: BorderSide(color: AppColor.border2Color(context)),
label: Text(_selectedItem[i].name!), label: Text(_selectedItem[index].name!),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
labelStyle: AppTextStyles.tinyFont2.copyWith(color: AppColor.labelTextStyleColor(context)), labelStyle: AppTextStyles.tinyFont2.copyWith(
color: AppColor.labelTextStyleColor(context),
),
deleteIconColor: AppColor.icon2Color(context), deleteIconColor: AppColor.icon2Color(context),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onDeleted: () { onDeleted: () {
_selectedItem.removeAt(i); setState(() {
setState(() {}); _selectedItem.removeAt(index);
});
widget.onSelect!(_selectedItem); widget.onSelect!(_selectedItem);
}, },
), ),
), ),
], ),
),
),
).paddingOnly(top: 4), ).paddingOnly(top: 4),
], ],
) )

Loading…
Cancel
Save