Flutter webview

This entry is part 1 of 2 in the series Flutter

Flutter webview:

Github: https://github.com/somaria/flutter_webview_try15

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:convert';
import 'package:webview_flutter/webview_flutter.dart';

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

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

class _MyAppState extends State<MyApp> {
  WebViewController _webviewController;

  String filePath = 'files/test.html';
  _loadHtmlFromAssets() async {
    String fileHtmlContents = await rootBundle.loadString(filePath);
              mimeType: 'text/html', encoding: Encoding.getByName('utf-8'))

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Webview Demo'),
        body: WebView(
          initialUrl: 'files/test.html',
          javascriptMode: JavascriptMode.unrestricted,
          onWebViewCreated: (WebViewController webviewController) {
            _webviewController = webviewController;
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: () {},
Series Navigation
Converting the default incrementing counter program to using the provider package >>

Leave a comment

Leave a Reply