viewer: fixed page position overlay for multipage entries with no page info
This commit is contained in:
parent
900cf5e427
commit
8de7896d4e
1 changed files with 5 additions and 2 deletions
|
@ -325,11 +325,14 @@ class _PositionTitleRow extends StatelessWidget {
|
|||
future: multiPageController.info,
|
||||
builder: (context, snapshot) {
|
||||
final multiPageInfo = snapshot.data;
|
||||
final pageCount = multiPageInfo?.pageCount ?? '?';
|
||||
final pageCount = multiPageInfo?.pageCount;
|
||||
// page count may be 0 when we know an entry to have multiple pages
|
||||
// but fail to get information about these pages
|
||||
final missingInfo = pageCount == 0;
|
||||
return ValueListenableBuilder<int>(
|
||||
valueListenable: multiPageController.pageNotifier,
|
||||
builder: (context, page, child) {
|
||||
return toText(pagePosition: '${page + 1}/$pageCount');
|
||||
return toText(pagePosition: missingInfo ? null : '${page + 1}/${pageCount ?? '?'}');
|
||||
},
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue