flutter_html_view 0.2.7 flutter_html_view: ^0.2.7 copied to clipboard
Flutter Plugin to render html
import 'package:flutter/material.dart';
import 'package:flutter_html_view/flutter_html_text.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
initPlatformState() async {
}
@override
Widget build(BuildContext context) {
String lorem = '<h1>This is heading 1</h1> <h2>This is heading 2</h2><h3>This is heading 3</h3><h4>This is heading 4</h4><h5>This is heading 5</h5><h6>This is heading 6</h6><p><img alt="Test Image" src="https://i.ytimg.com/vi/RHLknisJ-Sg/maxresdefault.jpg" /></p>';
// String lorem = "<em>Kacey Fahey, Developer Marketing, Google Play</em>\n\n<p>\nCongratulations to the latest <a href=\"https://play.google.com/store/apps/topic?id=campaign_editorial_3002b4f_android_excellence_apps&hl=en\">apps</a> and <a href=\"https://play.google.com/store/apps/topic?id=campaign_editorial_3002b50_android_excellence_games&hl=en\">games</a> featured in the Android Excellence program on Google Play. As a reminder, these collections are refreshed every three months and recognize apps and games that set the bar for high quality, great user experience, and strong technical performance. \n</p>\n<p>\n<a href=\"https://3.bp.blogspot.com/-WKwBKUfq5lA/WsUNQfbmhuI/AAAAAAAAFMA/KH6RE2zupHMzTb2fAm_4jsjAbP8L8lr4wCLcBGAs/s1600/image1.jpg\" imageanchor=\"1\" ><img id=\"imageOne\" border=\"0\" src=\"https://3.bp.blogspot.com/-WKwBKUfq5lA/WsUNQfbmhuI/AAAAAAAAFMA/KH6RE2zupHMzTb2fAm_4jsjAbP8L8lr4wCLcBGAs/s1600/image1.jpg\" data-original-width=\"1024\" data-original-height=\"592\" /></a>\n</p>\n<p>\nIf you're looking for some new apps, here are a few highlights.\n</p><ul>\n\n<li><a href=\"https://play.google.com/store/apps/details?id=com.adobe.lrmobile\">Adobe Photoshop Lightroom CC</a>: Capture, edit, and share your photos with the power of Lightroom on your mobile device. Use presets for quick and easy edits, or dive in with the advanced editing tools.\n<li><a href=\"https://play.google.com/store/apps/details?id=se.perigee.android.seven\">Seven - 7 Minute Workout Training Challenge</a>: Use this app to fit seven minute workouts into your busy lifestyle. Grab your phone, or even your Wear OS device to work out anywhere and anytime. Keep it up to earn achievements and join the 7 Club for even more support. \n<li><a href=\"https://play.google.com/store/apps/details?id=com.sololearn\">SoloLearn: Learn to Code for Free</a>: Learn one of many new coding languages by joining a community of millions. Tap in to the 24/7 peer support, or create your own lessons to become a community influencer.</li></ul>\n\n<p>\nHere are a few of our favorite new games joining the collection.\n</p><ul>\n\n<li><a href=\"https://play.google.com/store/apps/details?id=com.fanatee.cody\">CodyCross: Crossword Puzzles</a>: Try this game for a fun new style of crossword puzzles. Play for free on adventure mode or subscribe for special themed packs, varying difficulty levels and fresh content added weekly.\n<li><a href=\"https://play.google.com/store/apps/details?id=com.kabam.marvelbattle\">MARVEL Contest of Champions</a>: Play with your favorite Marvel Super Heroes and Super Villians in iconic locations from the Marvel Universe. Assemble your team of champions to play through the exciting storyline and even build alliances with your friends.\n<li><a href=\"https://play.google.com/store/apps/details?id=com.etermax.orbital1\">Orbital 1</a>: Test your skills in this real-time multiplayer game with beautiful 3D graphics. Collect and upgrade fighters and weapons to build out your perfect squad for quick battles and new daily quests.</li></ul>\n\n<p>\nSee the full list of Android Excellence apps and games.\n</p>\n\n<table>\n <tr>\n <td><strong><span style=\"text-decoration:underline;\">New Android Excellence apps</span></strong>\n </td>\n <td><strong><span style=\"text-decoration:underline;\">New Android Excellence games</span></strong>\n </td>\n </tr>\n <tr>\n <td><a href=\"https://play.google.com/store/apps/details?id=com.adobe.lrmobile\">Adobe Photoshop Lightroom CC</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.dashlane\">Dashlane</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.hostelworld.app\">Holstelworld</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.polydice.icook\">iCook</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.callpod.android_apps.keeper\">Keeper Password Manager</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.kii.safe\">Keepsafe Photo Vault</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.mobisystems.office\">Mobisystems OfficeSuite</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.roidapp.photogrid&ddl=1&pcampaignid=web_ddl_1&e=-EnableAppDetailsPageRedesign\">PhotoGrid</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.runtastic.android.results.lite&sticky_source_country=US&e=-EnableAppDetailsPageRedesign\">Runtastic Results</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=se.perigee.android.seven\">Seven - 7 Minute Workout Training Challenge</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.sololearn\">SoloLearn: Learn to Code for Free</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.mxdata.tube.Market\">Tube Map</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=cn.wps.moffice_eng\">WPS Office</a>\n </td>\n <td><a href=\"https://play.google.com/store/apps/details?id=com.rovio.baba&hl=en&e=-EnableAppDetailsPageRedesign\">Angry Birds 2</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.YoStarJP.AzurLane&hl=en&e=-EnableAppDetailsPageRedesign\">Azur Lane</a> アズールレーン\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.fanatee.cody\">CodyCross</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.pikpok.dr2.play&e=-EnableAppDetailsPageRedesign\">Into the Dead 2</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.sinyee.babybus.restaurant\">Little Panda Restaurant</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.kabam.marvelbattle\">MARVEL Contest of Champions</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.etermax.orbital1\">Orbital 1</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.yodo1.roda\">Rooms of Doom</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=pine.game.skydancer\">Sky Dancer Run</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.protostar.sling\">Sling Kong</a>\n<p>\n<a href=\"https://play.google.com/store/apps/details?id=com.ChillyRoom.DungeonShooter\">Soul Knight</a>\n </td>\n </tr>\n</table>\n\n\n<p>\nExplore other great apps and games in the <a href=\"https://play.google.com/store/apps/topic?id=editors_choice\">Editors' Choice</a> section on Google Play and <a href=\"https://developer.android.com/distribute/best-practices/index.html\">discover best practices</a> to help you build quality apps and games.\n</p>\n<center>\n<p>\n How useful did you find this blogpost?\n<br>\n<a href=\"https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?usp=pp_url&entry.753333049=1%E2%98%85+%E2%80%93+Not+at+all&entry.2056663615&entry.646747778=AndroidExcellencerefresh-10/27\" style=\"color:gold;\">★</a> <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?usp=pp_url&entry.753333049=2%E2%98%85+%E2%80%93+Not+very&entry.2056663615&entry.646747778=AndroidExcellencerefresh-10/27\" style=\"color:gold;\">★</a> <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?usp=pp_url&entry.753333049=3%E2%98%85+%E2%80%93+Somewhat&entry.2056663615&entry.646747778=AndroidExcellencerefresh-10/27\" style=\"color:gold;\">★</a> <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?usp=pp_url&entry.753333049=4%E2%98%85+%E2%80%93+Very&entry.2056663615&entry.646747778=AndroidExcellencerefresh-10/27\" style=\"color:gold;\">★</a> <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?usp=pp_url&entry.753333049=5%E2%98%85+%E2%80%93+Extremely&entry.2056663615&entry.646747778=AndroidExcellencerefresh-10/27\" style=\"color:gold;\">★</a>\n</p>\n\n<p>\n<a href=\"https://2.bp.blogspot.com/-eKVHlD1nQJE/WsUNzScG80I/AAAAAAAAFMI/KcXe_FGOk84wJq0PEqdvGAYMN4jJqIBsACLcBGAs/s1600/image2.png\" imageanchor=\"1\" ><img id=\"imageTwo\" border=\"0\" src=\"https://2.bp.blogspot.com/-eKVHlD1nQJE/WsUNzScG80I/AAAAAAAAFMI/KcXe_FGOk84wJq0PEqdvGAYMN4jJqIBsACLcBGAs/s1600/image2.png\" data-original-width=\"499\" data-original-height=\"281\" /></a>\n</p>\n</center>\n\n<style>\n#imageOne {\ndisplay: block;\nwidth: 90%;\nmargin: 10px auto;\npadding: 0;\n}\n\n#imageTwo {\ndisplay: block;\nwidth: 40%;\nmargin: 0px auto 0px auto;\npadding: 0;\n}\n\n#caption {\nfont-size: 85%;\nfont-style: italic;\ntext-align: center;\nmargin: 5px 0px 10px 0px\n}\n\ntable {\nline-height: 1.5em;\n}\n</style>";
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: new SingleChildScrollView(
child: new Center(
child: new HtmlTextView(data: lorem,),
),
),
),
);
}
}