Hello,
If I have a screen and want the body to contain 2 children (e.g. a breadcrumb, followed by your
SfPdfViewer
then, I get a hasSize error (please see the attachment). On the other hand, if I set your SfPdfViewer widget as the body then it all works fine (but I need breadcrumb in my case)
below is pseudo code for issue:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context)?.sample_text??
common.sample_test),
titleSpacing: 0,
elevation: 0, // appbar shadow off
),
body: Column(children: <Widget>[
breadCrumbBar(context, _crumbs), // My widget breadCrumbs
// I tried using sizeBox to limit height and that works but not ideal
SizedBox(
// If i set a height then it works but the pdf height is wrong depending
// on the device
// height: MediaQuery.of(context).size.height - 240,
child: SfPdfViewer.network(
headers: {
'Authorization': 'Bearer $_jwt',
},
interactionMode: PdfInteractionMode.pan,
_folder.listOfItems[_posterIndex].uri,
controller: _pdfViewerController,
key: _pdfViewerKey,
), //net
), // sizeBox
]), // children + column
); // Scaffold
} //
Any help will be greatl
Attachment:
hasSizeErr_c2562f53.zip