Advertisement
This is comment for paste
pdf reader
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- solved
- class Example extends StatefulWidget {
- const Example({super.key});
- @override
- State<Example> createState() => _ExampleState();
- }
- class _ExampleState extends State<Example> {
- Future<String> getPdfURL() async {
- await Future.delayed(const Duration(seconds: 5));
- return "http://example.com/pdf.pdf";
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: FutureBuilder(
- future: getPdfURL(), // add your future method here
- builder: (context, snapshot) {
- if (snapshot.connectionState == ConnectionState.waiting) {
- return const CircularProgressIndicator();
- } else if (snapshot.hasError) {
- return Text('Error: ${snapshot.error}');
- } else {
- String url = snapshot.data!;
- return YourPDFViewerWidget(url: url);
- }
- },
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement