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(
runSpacing: 4.toScreenHeight,
spacing: 4.toScreenWidth,
children: [
for (int i = 0; i < _selectedItem.length; i++)
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[i].name!),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
labelStyle: AppTextStyles.tinyFont2.copyWith(color: AppColor.labelTextStyleColor(context)),
deleteIconColor: AppColor.icon2Color(context),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onDeleted: () {
_selectedItem.removeAt(i);
setState(() {});
widget.onSelect!(_selectedItem);
},
children: List.generate(
_selectedItem.length,
(index) => 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),
],
)

Loading…
Cancel
Save