Created
May 28, 2022 14:40
-
-
Save daohoangson/178389000ff93267b1b4b77ee4554855 to your computer and use it in GitHub Desktop.
Nested HTML table in Flutter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Padding( | |
padding: const EdgeInsets.all(16), | |
child: Center( | |
child: MyWidget(), | |
), | |
), | |
), | |
); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const HtmlWidget( | |
r""" | |
<table border="1"> | |
<tr> | |
<td> | |
Hello. | |
</td> | |
<td> | |
<ul> | |
<li>One</li> | |
<li> | |
<table border="1"> | |
<tr> | |
<td>Two</td> | |
<td>Two</td> | |
</tr> | |
</table> | |
</li> | |
<li>Three</li> | |
</ul> | |
</td> | |
</tr> | |
</table> | |
""", | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment