flutter_pdf_render
flutter_pdf_render copied to clipboard
Scrollbar support?
Just want to say - I love this library, and is probably the easiest out of all of them to use.
Is there any scrollbar support, or do we have to add it manually or something?
The viewer is based on InteractiveViewer. And it won't support scrollbars.
By the way, I've just added a small update to the viewer, which makes it easier to implement scroll position indicator (not scroll bar) though I don't know whether it's enough to your app or not:
Stack(
children: [
PdfViewer(...),
// Simple scroll position indicator
ValueListenableBuilder(
valueListenable: controller,
builder: (context, m, child) {
if (!controller.isReady) return Container();
final v = controller.viewRect;
final all = controller.fullSize;
final top = v.top / all.height * v.height;
final height = v.height / all.height * v.height;
return Positioned(
right: 0,
top: top,
height: height,
width: 8,
child: Container(color: Colors.red),
);
},
),
],
),
Of course, it is possible to implement thumb-drag-to-move feature using PdfViewerController. But I don't have enough time to do that just now.
Anyway, I'll keep the issue to do extra work to fully support scroll bar.