Closed
Description
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