corrected the checkbox selection issue
This commit is contained in:
parent
9feb9d1b4b
commit
a6da579f07
@ -234,38 +234,41 @@ class _DirectoryFilterBottomSheetState
|
|||||||
itemCount: filteredList.length,
|
itemCount: filteredList.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final item = filteredList[index];
|
final item = filteredList[index];
|
||||||
final isSelected = selectedItems.contains(item.id);
|
|
||||||
|
|
||||||
return GestureDetector(
|
return Obx(() {
|
||||||
onTap: () => onToggle(item.id),
|
final isSelected = selectedItems.contains(item.id);
|
||||||
child: Container(
|
|
||||||
padding:
|
return GestureDetector(
|
||||||
const EdgeInsets.symmetric(horizontal: 4, vertical: 6),
|
onTap: () => onToggle(item.id),
|
||||||
child: Row(
|
child: Container(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(
|
||||||
Container(
|
horizontal: 4, vertical: 6),
|
||||||
width: 18,
|
child: Row(
|
||||||
height: 18,
|
children: [
|
||||||
decoration: BoxDecoration(
|
Container(
|
||||||
color:
|
width: 18,
|
||||||
isSelected ? Colors.blueAccent : Colors.white,
|
height: 18,
|
||||||
border: Border.all(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black,
|
color:
|
||||||
width: 1.2,
|
isSelected ? Colors.blueAccent : Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.black,
|
||||||
|
width: 1.2,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: isSelected
|
||||||
|
? const Icon(Icons.check,
|
||||||
|
size: 14, color: Colors.white)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
child: isSelected
|
const SizedBox(width: 8),
|
||||||
? const Icon(Icons.check,
|
MyText(item.name, fontSize: 14),
|
||||||
size: 14, color: Colors.white)
|
],
|
||||||
: null,
|
),
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
MyText(item.name, fontSize: 14),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user