fix: video continues playing after going to the next memory (#1517)

This commit is contained in:
Vishnu Mohandas 2023-11-18 16:48:44 +05:30 committed by GitHub
commit 7129add7d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -10,7 +10,6 @@ import "package:photos/models/memory.dart";
import "package:photos/services/memories_service.dart";
import "package:photos/theme/text_style.dart";
import "package:photos/ui/actions/file/file_actions.dart";
import "package:photos/ui/extents_page_view.dart";
import "package:photos/ui/viewer/file/file_widget.dart";
import "package:photos/ui/viewer/file_details/favorite_widget.dart";
import "package:photos/utils/file_util.dart";
@ -316,7 +315,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
}
}
},
child: ExtentsPageView.extents(
child: PageView.builder(
itemBuilder: (BuildContext context, int index) {
if (index < widget.memories.length - 1) {
final nextFile = widget.memories[index + 1].file;

View file

@ -92,9 +92,9 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
bool _areMemoriesFromSameYear(Memory first, Memory second) {
final firstDate =
DateTime.fromMicrosecondsSinceEpoch(first.file.creationTime!);
DateTime.fromMicrosecondsSinceEpoch(first.file.creationTime!);
final secondDate =
DateTime.fromMicrosecondsSinceEpoch(second.file.creationTime!);
DateTime.fromMicrosecondsSinceEpoch(second.file.creationTime!);
return firstDate.year == secondDate.year;
}
}