flutter_pdf_plugin_dade 0.0.3 flutter_pdf_plugin_dade: ^0.0.3 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 {
Map map = {};
map["bookId"] = "bookId";
map["bookPath"] = "/storage/emulated/0/android/2_物理手册.pdf";
map["pageIndex"] = "0";
String pdfInfo = await FlutterPdfPluginDade.readPdf(map);
// 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("打开文件"),
),
),
),
);
}
}