Selaa lähdekoodia

Add prefix to the key to reduce the possibility of collisions

vishnukvmd 2 vuotta sitten
vanhempi
commit
d3ab60e261
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      lib/ui/huge_listview/lazy_loading_gallery.dart

+ 2 - 2
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -352,7 +352,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
 
   Widget _getRecyclableView() {
     return VisibilityDetector(
-      key: Key(widget.filesInDay.first.tag),
+      key: Key("gallery" + widget.filesInDay.first.tag),
       onVisibilityChanged: (visibility) {
         final shouldRender = visibility.visibleFraction > 0;
         if (mounted && shouldRender != _shouldRender) {
@@ -370,7 +370,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
   Widget _getNonRecyclableView() {
     if (!_shouldRender!) {
       return VisibilityDetector(
-        key: Key(widget.filesInDay.first.tag),
+        key: Key("gallery" + widget.filesInDay.first.tag),
         onVisibilityChanged: (visibility) {
           if (mounted && visibility.visibleFraction > 0 && !_shouldRender!) {
             setState(() {