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),
child: Chip( curve: Curves.easeInOut,
backgroundColor: AppColor.backgroundTabBarColor(context), child: AnimatedOpacity(
side: BorderSide(color: AppColor.border2Color(context)), opacity: _selectedItem.contains(_selectedItem[index]) ? 1.0 : 0.0,
label: Text(_selectedItem[i].name!), duration: const Duration(milliseconds: 300),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)), curve: Curves.easeInOut,
labelStyle: AppTextStyles.tinyFont2.copyWith(color: AppColor.labelTextStyleColor(context)), child: Theme(
deleteIconColor: AppColor.icon2Color(context), data: Theme.of(context).copyWith(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, splashColor: Colors.transparent,
onDeleted: () { highlightColor: Colors.transparent,
_selectedItem.removeAt(i); ),
setState(() {}); child: Chip(
widget.onSelect!(_selectedItem); 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), ).paddingOnly(top: 4),
], ],
) )

Loading…
Cancel
Save