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

[BUG] Html Widget in AlertDialog with custom insetPadding #1184

Closed
mauriceraguseinit opened this issue Nov 1, 2022 · 2 comments
Closed

[BUG] Html Widget in AlertDialog with custom insetPadding #1184

mauriceraguseinit opened this issue Nov 1, 2022 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@mauriceraguseinit
Copy link

Describe the bug:
in flutter_html 3.0.0-alpha.6 I can't rendert HTML in an AlertDialog. On some Devices it works, but eg. on Tablets it crashes ... the problem is releated with the insetPadding property of the AlertDialog Widget. In flutter_html 2.x it works perfectly.

HTML to reproduce the issue:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        floatingActionButton: Builder(
          builder: (context) {
            return FloatingActionButton(
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (context) => AlertDialog(
                        insetPadding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 24.0), //this is crashing the app
                        content: Html(data: 'hello')));
              },
              child: const Icon(Icons.add),
            );
          },
        ),
      ),
    ),
  );
}

Html widget configuration:
default

Expected behavior:
show text in alert dialog

Screenshots:
nothing to show

Device details and Flutter/Dart/flutter_html versions:
Flutter 3.3.6, flutter_html 3.0.0-alpha.6

Stacktrace/Logcat

E/flutter (20254): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Cannot hit test a render box with no size.
E/flutter (20254): The hitTest() method was called on this RenderBox: RenderConstrainedBox#d3c76 relayoutBoundary=up1:
E/flutter (20254): creator: ConstrainedBox ← Align ← MediaQuery ← Padding ← AnimatedPadding ← Dialog ← AlertDialog ← MediaQuery ← Padding ← DisplayFeatureSubScreen ← Semantics ← Builder ← ⋯
E/flutter (20254): parentData: offset=Offset(0.0, 0.0) (can use size)
E/flutter (20254): constraints: BoxConstraints(0.0<=w<=292.0, 0.0<=h<=642.7)
E/flutter (20254): size: MISSING
E/flutter (20254): additionalConstraints: BoxConstraints(280.0<=w<=Infinity, 0.0<=h<=Infinity)
E/flutter (20254): Although this node is not marked as needing layout, its size is not set.
E/flutter (20254): A RenderBox object must have an explicit size before it can be hit-tested. Make sure that the RenderBox in question sets its size during layout.
E/flutter (20254): #0 RenderBox.hitTest. (package:flutter/src/rendering/box.dart:2494:9)
E/flutter (20254): #1 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2509:6)
E/flutter (20254): #2 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #3 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #4 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #5 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #6 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #7 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #8 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #9 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #10 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #11 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #12 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #13 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #14 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #15 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #16 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #17 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #18 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #19 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #20 RenderIgnorePointer.hitTest (package:flutter/src/rendering/proxy_box.dart:3618:31)
E/flutter (20254): #21 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #22 RenderTransform.hitTestChildren. (package:flutter/src/rendering/proxy_box.dart:2590:22)
E/flutter (20254): #23 BoxHitTestResult.addWithRawTransform (package:flutter/src/rendering/box.dart:844:31)
E/flutter (20254): #24 BoxHitTestResult.addWithPaintTransform (package:flutter/src/rendering/box.dart:769:12)
E/flutter (20254): #25 RenderTransform.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:2586:19)
E/flutter (20254): #26 RenderTransform.hitTest (package:flutter/src/rendering/proxy_box.dart:2580:12)
E/flutter (20254): #27 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #28 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #29 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #30 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #31 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #32 _RenderFocusTrap.hitTest (package:flutter/src/widgets/routes.dart:2217:19)
E/flutter (20254): #33 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #34 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #35 RenderProxyBo
E/flutter (20254): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Cannot hit test a render box with no size.
E/flutter (20254): The hitTest() method was called on this RenderBox: RenderConstrainedBox#d3c76 relayoutBoundary=up1:
E/flutter (20254): creator: ConstrainedBox ← Align ← MediaQuery ← Padding ← AnimatedPadding ← Dialog ← AlertDialog ← MediaQuery ← Padding ← DisplayFeatureSubScreen ← Semantics ← Builder ← ⋯
E/flutter (20254): parentData: offset=Offset(0.0, 0.0) (can use size)
E/flutter (20254): constraints: BoxConstraints(0.0<=w<=292.0, 0.0<=h<=642.7)
E/flutter (20254): size: MISSING
E/flutter (20254): additionalConstraints: BoxConstraints(280.0<=w<=Infinity, 0.0<=h<=Infinity)
E/flutter (20254): Although this node is not marked as needing layout, its size is not set.
E/flutter (20254): A RenderBox object must have an explicit size before it can be hit-tested. Make sure that the RenderBox in question sets its size during layout.
E/flutter (20254): #0 RenderBox.hitTest. (package:flutter/src/rendering/box.dart:2494:9)
E/flutter (20254): #1 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2509:6)
E/flutter (20254): #2 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #3 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #4 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #5 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #6 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #7 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #8 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #9 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #10 RenderShiftedBox.hitTestChildren. (package:flutter/src/rendering/shifted_box.dart:97:25)
E/flutter (20254): #11 BoxHitTestResult.addWithPaintOffset (package:flutter/src/rendering/box.dart:805:31)
E/flutter (20254): #12 RenderShiftedBox.hitTestChildren (package:flutter/src/rendering/shifted_box.dart:92:21)
E/flutter (20254): #13 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #14 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #15 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #16 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #17 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #18 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #19 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #20 RenderIgnorePointer.hitTest (package:flutter/src/rendering/proxy_box.dart:3618:31)
E/flutter (20254): #21 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #22 RenderTransform.hitTestChildren. (package:flutter/src/rendering/proxy_box.dart:2590:22)
E/flutter (20254): #23 BoxHitTestResult.addWithRawTransform (package:flutter/src/rendering/box.dart:844:31)
E/flutter (20254): #24 BoxHitTestResult.addWithPaintTransform (package:flutter/src/rendering/box.dart:769:12)
E/flutter (20254): #25 RenderTransform.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:2586:19)
E/flutter (20254): #26 RenderTransform.hitTest (package:flutter/src/rendering/proxy_box.dart:2580:12)
E/flutter (20254): #27 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #28 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #29 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #30 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #31 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #32 _RenderFocusTrap.hitTest (package:flutter/src/widgets/routes.dart:2217:19)
E/flutter (20254): #33 RenderProxyBoxMixin.hitTestChildren (package:flutter/src/rendering/proxy_box.dart:135:19)
E/flutter (20254): #34 RenderBox.hitTest (package:flutter/src/rendering/box.dart:2511:11)
E/flutter (20254): #35 RenderProxyBo

Additional info:

A picture of a cute animal (not mandatory but encouraged)

@mauriceraguseinit mauriceraguseinit added the bug Something isn't working label Nov 1, 2022
@Sub6Resources Sub6Resources added the in-triage Issue's that I've seen but haven't had a chance to thoroughly review and/or categorize label Nov 2, 2022
@erickok
Copy link
Collaborator

erickok commented Nov 6, 2022

Probably as duplicate of #1165 as the Html widget no longer reports it's intrinsic height.

@Sub6Resources Sub6Resources added duplicate This issue or pull request already exists and removed in-triage Issue's that I've seen but haven't had a chance to thoroughly review and/or categorize labels May 17, 2023
@Sub6Resources
Copy link
Owner

Closing as duplicate

@Sub6Resources Sub6Resources closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants