flutter_super_html_viewer 0.0.2 copy "flutter_super_html_viewer: ^0.0.2" to clipboard
flutter_super_html_viewer: ^0.0.2 copied to clipboard

A Flutter plugin that provides a HtmlViewer widget on multiple platforms

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

const _htmlContent =
    '''<p>Here is some text</p> with a <a href="https://github.com/dab246/flutter_super_webview" target="_blank">link</a>.
  <p>Here is <b>bold</b> text</p>
  <p>Here is <i>some italic sic</i> text</p>
  <p>Here is <i><b>bold and italic</b></i> text</p>
  <p style="text-align: center;">Here is <u><i><b>bold and italic and underline</b></i></u> text</p>
  <ul><li>one list element</li><li>another point</li></ul>
  <blockquote>Here is a quote<br/>
    that spans several lines<br/>
    <blockquote>
        Another second level blockqote 
    </blockquote>
  </blockquote>
''';

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'WebView Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'WebView Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        backgroundColor: Colors.white,
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              HtmlContentViewer(
                htmlContent: _htmlContent,
                initialContentHeight: MediaQuery.of(context).size.height,
                initialContentWidth: MediaQuery.of(context).size.width,
              )
            ],
          ),
        ) // This trailing comma makes auto-formatting nicer for build methods.
        );
  }
}
17
likes
110
pub points
92%
popularity

Publisher

unverified uploader

A Flutter plugin that provides a HtmlViewer widget on multiple platforms

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter, universal_html, url_launcher, webview_flutter, webview_windows

More

Packages that depend on flutter_super_html_viewer