瀏覽代碼

Fix errors in the memory widget

Vishnu Mohandas 5 年之前
父節點
當前提交
0b640bf322
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/ui/memories_widget.dart

+ 3 - 3
lib/ui/memories_widget.dart

@@ -87,7 +87,7 @@ class MemoryWidget extends StatelessWidget {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    final index = _getUnseenMemoryIndex();
+    final index = _getNextMemoryIndex();
     final title = _getTitle(memories[index]);
     final title = _getTitle(memories[index]);
     return GestureDetector(
     return GestureDetector(
       onTap: () {
       onTap: () {
@@ -147,7 +147,7 @@ class MemoryWidget extends StatelessWidget {
     );
     );
   }
   }
 
 
-  int _getUnseenMemoryIndex() {
+  int _getNextMemoryIndex() {
     for (var index = 0; index < memories.length; index++) {
     for (var index = 0; index < memories.length; index++) {
       if (!memories[index].isSeen()) {
       if (!memories[index].isSeen()) {
         return index;
         return index;
@@ -261,7 +261,6 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
                 autoPlay: true,
                 autoPlay: true,
               );
               );
       },
       },
-      index: _index,
       itemCount: widget.memories.length,
       itemCount: widget.memories.length,
       pagination: SwiperPagination(
       pagination: SwiperPagination(
           alignment: Alignment.bottomCenter,
           alignment: Alignment.bottomCenter,
@@ -279,6 +278,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
         setState(() {
         setState(() {
           _index = index;
           _index = index;
         });
         });
+        return index;
       },
       },
     );
     );
   }
   }