navPoints property
Gets a list of navigation points in the EPUB document.
Implementation
List<NavPoint> get navPoints {
return document.findAllElements('navPoint').map((final navPointElement) {
final classAttribute = navPointElement.getAttribute('class');
final id = navPointElement.getAttribute('id');
final playOrder = navPointElement.getAttribute('playOrder');
final label = navPointElement
.findElements('navLabel')
.first
.findElements('text')
.first
.value ??
'';
final content =
navPointElement.findElements('content').first.getAttribute('src');
final subNavPoints = navPointElement
.findElements('navPoint')
.map((final subNavPointElement) {
return NavPoint(
classAttribute: subNavPointElement.getAttribute('class') ?? '',
id: subNavPointElement.getAttribute('id') ?? '',
playOrder: subNavPointElement.getAttribute('playOrder') ?? '',
label: subNavPointElement
.findElements('navLabel')
.first
.findElements('text')
.first
.value ??
'',
content: subNavPointElement
.findElements('content')
.first
.getAttribute('src') ??
'',
);
}).toList();
return NavPoint(
classAttribute: classAttribute ?? '',
id: id ?? '',
playOrder: playOrder ?? '',
label: label,
content: content ?? '',
subNavPoints: subNavPoints,
);
}).toList();
}