diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart index 222a4e7a..a8fa733e 100644 --- a/lib/generated_plugin_registrant.dart +++ b/lib/generated_plugin_registrant.dart @@ -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(); } diff --git a/lib/ui/profile/house/contract_preview_page.dart b/lib/ui/profile/house/contract_preview_page.dart index 736636fc..62772cd6 100644 --- a/lib/ui/profile/house/contract_preview_page.dart +++ b/lib/ui/profile/house/contract_preview_page.dart @@ -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 { 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( diff --git a/pubspec.lock b/pubspec.lock index d7dac438..ffc67ea6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index f28e24de..55f87de6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: