Render Raw Html Code String In Webview
Step 1: We cannot directly remove the time stamp from Render Raw Html Code String In Webview but using the intl.dart package we can easily filter the date stamp from time stamp. So open your flutter project’s pubspec.yaml in code
dependencies: flutter: sdk: flutter flutter_webview_plugin: ^0.3.10+1
flutter pub get
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:flutter/material.dart'; import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: Html() ) ); } } class Html extends StatefulWidget { LoadHtml createState() => LoadHtml(); } class LoadHtml extends State<Html>{ var HtmlCode = '<h1> H1 Lorem Ipsum</h1>' + '<h2> H2 Lorem Ipsum</h2>' + '<p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>' + '<img src="https://flutter-examples.com/wp-content/uploads/2020/02/dice.jpg" alt="Image" width="250" height="150" border="3">' ; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Colors.red, title: Text('Render Raw HTML Code' )), body: WebviewScaffold( url: new Uri.dataFromString(HtmlCode, mimeType: 'text/html').toString(), ), ); } }