@@ -11,6 +11,7 @@ import 'package:webview_flutter_android/webview_flutter_android.dart';
1111import '../../../app/app.locator.dart' ;
1212import '../../../app/app.router.dart' ;
1313import '../../../common/enums.dart' ;
14+ import '../../../common/oet_rv_section_start_end.dart' ;
1415import '../../../common/themes.dart' ;
1516import '../../../common/toast.dart' ;
1617import '../../../services/bibles_service.dart' ;
@@ -123,8 +124,20 @@ class ReaderViewModel extends ReactiveViewModel {
123124 themeName = CurrentTheme .contrast.name;
124125 }
125126
126- // Jump to id
127- String id = '$bookCode $chapterNumber :1' ; // TODO: set appropriate verse number
127+ // If viewBy is 'section', jump to a specific verse. Otherwise
128+ // for 'chapter' we fallback on the first verse of the chapter.
129+ String id = '$bookCode $chapterNumber :1' ;
130+ if (viewBy == ViewBy .section) {
131+ Map <String , dynamic >? sectionReferences = sectionStartEndMappingForOET[bookCode]? [sectionNumber];
132+
133+ if (sectionReferences != null ) {
134+ Map <String , int > startReference = sectionReferences['start' ]! ;
135+ int startChapter = startReference['chapter' ]! ;
136+ int startVerse = startReference['verse' ]! ;
137+
138+ id = '$bookCode $startChapter :$startVerse ' ;
139+ }
140+ }
128141
129142 Uri htmlUri = Uri .dataFromString ("""
130143<!DOCTYPE html>
0 commit comments