添加 pdf预览

hmxc
张萌 3 years ago
parent f70686af33
commit 6306a8e1c2

@ -9,6 +9,7 @@ import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:syncfusion_flutter_pdfviewer_web/pdfviewer_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
@ -20,6 +21,7 @@ void registerPlugins(Registrar registrar) {
ImagePickerPlugin.registerWith(registrar);
PackageInfoPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
SyncfusionFlutterPdfViewerPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}

@ -2,7 +2,6 @@ import 'dart:io';
import 'dart:typed_data';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/ui/profile/house/download_contract_page.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
@ -15,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
import 'package:velocity_x/velocity_x.dart';
class ContractPreviewPage extends StatefulWidget {
@ -59,18 +59,7 @@ class _ContractPreviewPageState extends State<ContractPreviewPage> {
title: '合同预览',
body: ListView(
children: [
Stack(
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(widget.url)),
Positioned(
right: 70.w,
bottom: 200.w,
child: signName,
),
],
),
SfPdfViewer.network(API.image(widget.url)),
],
),
bottomNavi: BottomButton(

@ -1054,6 +1054,41 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
syncfusion_flutter_core:
dependency: transitive
description:
name: syncfusion_flutter_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "19.1.69"
syncfusion_flutter_pdf:
dependency: transitive
description:
name: syncfusion_flutter_pdf
url: "https://pub.flutter-io.cn"
source: hosted
version: "19.1.69-beta"
syncfusion_flutter_pdfviewer:
dependency: "direct main"
description:
name: syncfusion_flutter_pdfviewer
url: "https://pub.flutter-io.cn"
source: hosted
version: "19.1.69-beta"
syncfusion_flutter_pdfviewer_platform_interface:
dependency: transitive
description:
name: syncfusion_flutter_pdfviewer_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "19.1.69-beta"
syncfusion_flutter_pdfviewer_web:
dependency: transitive
description:
name: syncfusion_flutter_pdfviewer_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "19.1.69-beta"
synchronized:
dependency: transitive
description:

@ -104,6 +104,9 @@ dependencies:
qr_code_scanner: ^0.4.0
#model 插件
equatable: ^2.0.0
#pdf文件预览
syncfusion_flutter_pdfviewer: ^19.1.69-beta
dev_dependencies:
flutter_test:

Loading…
Cancel
Save