Fix errors in the memory widget

This commit is contained in:
Vishnu Mohandas 2020-07-29 18:50:44 +05:30
parent bdc4615599
commit 0b640bf322

View file

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