PDF 查看小部件在查看期间不断重建

PDF view widget constant rebuild during view

我在一个简单的应用程序中使用 syncfusion PDFviewer 来显示来自 URL 使用 flutter 的 PDF。当我检查 performance tap 时,它显示小部件不断重建,即使页面已完全加载并且我没有与模拟器交互。我不确定这是否应该发生,但我没有在任何其他屏幕上看到这一点。访问资产或本地文件中的 PDF 时也会发生。这是否需要回调或 setstate 来停止刷新?识字,识技。

下面是我的代码:

import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';

void main() {
runApp(MyApp());}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
 return MaterialApp(
  title: 'SF PDFViewer Test',
  theme: ThemeData(
    primarySwatch: Colors.blue,
  ),
  home: MyHomePage(),
 );}}

 class MyHomePage extends StatefulWidget {
 @override
 _MyHomePageState createState() => _MyHomePageState();}

 class _MyHomePageState extends State<MyHomePage> {
 @override
 Widget build(BuildContext context) {
 return Scaffold(
   appBar: AppBar(
     title: Text('SF PDF Viewer Example'),),
  body: Center(),
  floatingActionButton: FloatingActionButton(
    onPressed: () => Navigator.push(
        context, MaterialPageRoute(builder: (context) => PdfViewerApp())),
    tooltip: 'View PDF',
    child: Icon(Icons.document_scanner_rounded),
  ),);}}

 class PdfViewerApp extends StatelessWidget {
 const PdfViewerApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
 return SafeArea(
   child: Scaffold(
     appBar: AppBar(
       title: Text('SF PDFViewer'),
    ),
    body:
      Container(
        child: 
   SfPdfViewer.network('http://www.pdf995.com/samples/pdf.pdf'),
      ),),);}}

这是我的颤振医生

 Doctor summary (to see all details, run flutter doctor -v):
 [✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale en-US)
 [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android license status unknown.
    Run `flutter doctor --android-licenses` to accept the SDK licenses.
    See https://flutter.dev/docs/get-started/install/macos#android-setup for more 
    details.
  [✓] Xcode - develop for iOS and macOS
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 4.2)
  [✓] Connected device (3 available)

  ! Doctor found issues in 1 category.

我们确认“SfPdfViewer 在没有任何用户交互的情况下持续重建”的问题是一个缺陷。问题修复将包含在我们 7 月 3 日的每周软件包版本中,预计暂定于 2021 年 7 月 20 日发布。

可以使用以下 link 跟踪此问题的状态。 https://www.syncfusion.com/feedback/26815/sfpdfviewer-rebuilds-continuously-without-any-user-interactions