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

Start http service, visit url to get html string

html_server #

Start http service, visit url to get html string

Getting Started #


class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  HtmlServer server;

  @override
  Widget build(BuildContext context) {
    return Container(
      child: server == null ? CircularProgressIndicator() : WebView(
        initialUrl: server.url,
      ),
    );
  }

  initWeb() async {
    String html = "<html><p>hello my friend</p></html>";
    server = await HtmlServer.serve(html);
    setState(() {});
  }
  
  @override
  void initState() {
    initWeb();
    super.initState();
  }
  
  @override
  void dispose() {
    server.dispose();
    super.dispose();
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

Start http service, visit url to get html string

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on html_server