Fix inventory object tile selection highlight

This commit is contained in:
Nutcake 2023-11-01 15:45:07 +01:00
parent cf3c95d1d8
commit af43af673d

View file

@ -169,9 +169,6 @@ class _InventoryBrowserState extends State<InventoryBrowser> with AutomaticKeepA
); );
}, },
), ),
const SizedBox(
height: 0,
),
GridView.builder( GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@ -187,6 +184,24 @@ class _InventoryBrowserState extends State<InventoryBrowser> with AutomaticKeepA
final record = objects[index]; final record = objects[index];
return ObjectInventoryTile( return ObjectInventoryTile(
record: record, record: record,
selected: iClient.isRecordSelected(record),
onTap: iClient.isAnyRecordSelected
? () async {
iClient.toggleRecordSelected(record);
}
: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PhotoView(
minScale: PhotoViewComputedScale.contained,
imageProvider:
CachedNetworkImageProvider(Aux.resdbToHttp(record.thumbnailUri)),
heroAttributes: PhotoViewHeroAttributes(tag: record.id),
),
),
);
},
onLongPress: () async { onLongPress: () async {
iClient.toggleRecordSelected(record); iClient.toggleRecordSelected(record);
}, },