html_to_markdown 0.0.1 copy "html_to_markdown: ^0.0.1" to clipboard
html_to_markdown: ^0.0.1 copied to clipboard

discontinued

Flutter plugin for converting html to markdown

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:html_to_markdown/html_to_markdown.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String results =  "WAIT RESULT";

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      results = await HtmlToMarkdown.convert("<h1>Some Header</h1> ", MarkdownOption.Github);
    } on PlatformException {
      results = 'Failed to get result.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      results = results;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('$results'),
        ),
      ),
    );
  }
}
0
likes
20
points
11
downloads

Publisher

verified publisherglenfordwilliams.com

Weekly Downloads

Flutter plugin for converting html to markdown

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on html_to_markdown

Packages that implement html_to_markdown