flutter_pdf_plugin_dade 0.0.2 flutter_pdf_plugin_dade: ^0.0.2 copied to clipboard
A new Flutter Plugin.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_pdf_plugin_dade/flutter_pdf_plugin_dade.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> _initData() async {
String jsonInfo = "{\"bookId\":\"1\",\"bookPath\":\"2\",\"pageIndex\":0}";
String pdfInfo = await FlutterPdfPluginDade.readPdf(jsonInfo);
// ignore: avoid_print
print(pdfInfo);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: MaterialButton(
onPressed: _initData,
textColor: Colors.white,
color: Colors.blue,
// ignore: prefer_const_constructors
child: Text("打开文件"),
),
),
),
);
}
}