flutter_pdf_plugin_dade 0.0.6 flutter_pdf_plugin_dade: ^0.0.6 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> {
var text = '打开文件';
@override
void initState() {
super.initState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> _initData() async {
Map<String, String> map = {};
map["bookId"] = "booId";
map["bookPath"] = "/storage/emulated/0/android/2_物理手册.pdf";
map["pageIndex"] = "13";
map["baseUrl"] = "http://139.129.96.143:8083";
map["userId"] = "123456";
var page = await FlutterPdfPluginDade.readPdf(map);
setState(() {
text = page;
});
}
@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("打开文件"),
),
),
),
);
}
}