Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table inside Wrap widget causes TooManyPagesException #1824

Open
enloc-port opened this issue Mar 4, 2025 · 0 comments
Open

Table inside Wrap widget causes TooManyPagesException #1824

enloc-port opened this issue Mar 4, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@enloc-port
Copy link

enloc-port commented Mar 4, 2025

Description
Nesting a large Table inside a Wrap causes a TooManyPagesException if the table exceeds the page height.

However, without the Wrap widget, the Table automatically spans to the next page.

There is no obvious reason why a Table should not be able to span to the next page when nested in a Wrap widget. Especially when composing many spanning and non-spanning widgets together, the Wrap should ensure that all these widgets can wrap to the next page.

Reproduce

final Document doc = Document();

doc.addPage(
  MultiPage(
    maxPages: 100,
    build: (Context context) {
      return <Widget>[
        Wrap(
          children: <Widget>[
            Table(
              children: List<TableRow>.generate(
                100,
                (int index) => TableRow(children: <Widget>[Text('row $index')]),
              ),
            ),
          ],
        ),
      ];
    },
  ),
);

doc.save();

Expected behavior
A Table inside a Wrap will span to the next page when the Wrap's children exceed the page height.

Package version
pdf 3.11.3

Flutter Doctor

[√] Flutter (Channel stable, 3.24.5, on Microsoft Windows [Version 10.0.22631.4890], locale de-DE)
    • Flutter version 3.24.5 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (4 months ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\fmalinowski\AppData\Local\Android\Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_SDK_ROOT = C:\Users\fmalinowski\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.40)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.35229.62
    • Windows 10 SDK version 10.0.19041.0
    X The current Visual Studio installation is incomplete.
      Please use Visual Studio Installer to complete the installation or reinstall Visual Studio.

[√] Android Studio (version 2024.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] VS Code (version 1.96.4)
    • VS Code at C:\Users\fmalinowski\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] VS Code, 64-bit edition (version 1.96.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.4890]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 133.0.6943.127
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 132.0.2957.140

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Tablet

  • Device: Tablet emulator
  • OS: Android 13
@enloc-port enloc-port added bug Something isn't working needs triage labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant