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 crash when used inside a DataTable #1459

Open
EArminjon opened this issue Jan 30, 2025 · 0 comments · May be fixed by #1460
Open

[BUG] Html crash when used inside a DataTable #1459

EArminjon opened this issue Jan 30, 2025 · 0 comments · May be fixed by #1460
Labels
bug Something isn't working

Comments

@EArminjon
Copy link

Describe the bug:

Code throw when running Html inside DataTable widget.

HTML to reproduce the issue:

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

void main() async {
  runApp(
    const TestApp(),
  );
}

class TestApp extends StatelessWidget {
  const TestApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: DataTable(
          columns: const <DataColumn>[
            DataColumn(
              label: Text('First column'),
            ),
            DataColumn(
              label: Text('Second column'),
            ),
          ],
          rows: <DataRow>[
            DataRow(
              cells: <DataCell>[
                DataCell(
                  Html(
                    data: 'Test',
                  ),
                ),
                const DataCell(
                  Text(
                    'Second cell',
                  ),
                ),
              ],
            ),
            const DataRow(
              cells: <DataCell>[
                DataCell(
                  Text('First cell'),
                ),
                DataCell(
                  Text(
                    'Second cell',
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

Expected behavior:

Want to see my html

Screenshots:

Nothing appear, red screen

Device details and Flutter/Dart/flutter_html versions:

Stacktrace/Logcat

Performing hot restart...
Syncing files to device macOS...
Restarted application in 269ms.

======== Exception caught by rendering library =====================================================
The following assertion was thrown during performLayout():
The RenderCSSBox class does not implement "computeDryBaseline".


If you are not writing your own RenderBox subclass, then this is not
your fault. Contact support: https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was: 
  DataTable DataTable:file:///Users/earminjon/Documents/projects/bioderma/lib/main.dart:28:16
When the exception was thrown, this was the stack: 
#0      RenderBox.debugCannotComputeDryLayout.<anonymous closure> (package:flutter/src/rendering/box.dart:2154:9)
#1      RenderBox.debugCannotComputeDryLayout (package:flutter/src/rendering/box.dart:2158:6)
#2      RenderBox.computeDryBaseline (package:flutter/src/rendering/box.dart:2114:12)
#3      RenderBox._computeDryBaseline (package:flutter/src/rendering/box.dart:2071:50)
#4      _Baseline.memoize.ifAbsent (package:flutter/src/rendering/box.dart:1041:42)
#5      _LinkedHashMapMixin.putIfAbsent (dart:_compact_hash:636:23)
#6      _Baseline.memoize (package:flutter/src/rendering/box.dart:1042:18)
#7      RenderBox._computeWithTimeline (package:flutter/src/rendering/box.dart:1561:32)
#8      RenderBox._computeIntrinsics (package:flutter/src/rendering/box.dart:1539:26)
#9      RenderBox.getDryBaseline (package:flutter/src/rendering/box.dart:2055:36)
#10     _RenderScaledInlineWidget.computeDryBaseline (package:flutter/src/widgets/widget_span.dart:388:37)
...

Additional info:

Flutter 3.27.2

@EArminjon EArminjon added the bug Something isn't working label Jan 30, 2025
@EArminjon EArminjon linked a pull request Jan 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant