mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
Fix non-unique key used to detect visibility
This commit is contained in:
parent
e5fa14943c
commit
dccb57f32e
1 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,7 @@ import 'package:nc_photos/session_storage.dart';
|
|||
import 'package:nc_photos/snack_bar_manager.dart';
|
||||
import 'package:nc_photos/widget/measurable_item_list.dart';
|
||||
import 'package:nc_photos/widget/selectable.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
|
||||
abstract class SelectableItem {
|
||||
|
@ -164,7 +165,7 @@ mixin SelectableItemStreamListMixin<T extends StatefulWidget> on State<T> {
|
|||
}
|
||||
if (isEnableVisibilityCallback) {
|
||||
content = VisibilityDetector(
|
||||
key: Key("$index"),
|
||||
key: Key("$_itemKeyPrefix.$index"),
|
||||
child: content,
|
||||
onVisibilityChanged: (info) => onVisibilityChanged(info, index, item),
|
||||
);
|
||||
|
@ -271,6 +272,8 @@ mixin SelectableItemStreamListMixin<T extends StatefulWidget> on State<T> {
|
|||
final _selectedItems = <SelectableItem>{};
|
||||
|
||||
final _listKey = GlobalKey();
|
||||
late final _itemKeyPrefix =
|
||||
"widget.selectable_item_stream_list_mixin.SelectableItemStreamListMixin.${const Uuid().v4()}";
|
||||
|
||||
/// used to gain focus on web for keyboard support
|
||||
final _keyboardFocus = FocusNode();
|
||||
|
|
Loading…
Reference in a new issue