You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. Replace the constant URL in the `SfPdfViewer.network` constructor with the `url` parameter that is passed to the widget.
147
+
148
+
{% tabs %}
149
+
{% highlight Dart hl_lines="18 19" %}
150
+
151
+
@override
152
+
Widget build(BuildContext context) {
153
+
return Scaffold(
154
+
appBar: AppBar(
155
+
title: const Text('Flutter PDF Viewer'),
156
+
actions: <Widget>[
157
+
IconButton(
158
+
icon: const Icon(
159
+
Icons.bookmark,
160
+
color: Colors.white,
161
+
),
162
+
onPressed: () {
163
+
_pdfViewerKey.currentState?.openBookmarkView();
164
+
},
165
+
),
166
+
],
167
+
),
168
+
body: SfPdfViewer.network(
169
+
widget.url,
170
+
key: _pdfViewerKey,
171
+
),
172
+
);
173
+
}
174
+
175
+
{% endhighlight %}
176
+
{% endtabs %}
177
+
178
+
5. Save the changes and click the `Compile Code` button to compile the custom code.
179
+
180
+
6. On the canvas, select the `PDFViewerWidget` and enter the PDF document URL in the `url` field of the `Custom Widget Properties` section.
181
+
182
+

183
+
184
+
In this example, we pass `url` as a parameter and use the `SfPdfViewer.network` constructor to display the PDF document. Similarly, you can use the `SfPdfViewer.file` or `SfPdfViewer.memory` constructor to display a PDF document of your choice.
185
+
186
+
>**Note**: To display a PDF document from an **Uploaded File (Bytes)** in FlutterFlow, add a parameter of type `FFUploadedFile` (you can find this exact type by clicking the `View Boilerplate Code` button) and then use the `SfPdfViewer.memory` constructor with the uploaded file bytes. See the code snippet below.
0 commit comments