easy_web_view 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

easy_web_view #

Easy Web Views in Flutter on Web and Mobile!

Getting Started #

Setup iOS Info.plist

<key>io.flutter.embedded_views_preview</key>
<true/>

For Loading a new url or changing width/height just call setState!

EasyWebView(
  src: 'https://flutter.dev',
// width: 100,
// height: 100,
)

Screenshots #

1.0.1 #

  • Added Allow Fullscreen on Web

1.0.0 #

  • Initial Plugin

example/README.md

example #

A new Flutter project.

Example #

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

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  String url = 'https://flutter.dev';
  int _currentIndex = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter Live View'),
      ),
      body: EasyWebView(
        src: url,
      ),
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _currentIndex,
        onTap: (val) {
          if (mounted)
            setState(() {
              url = _getUrl(val);
              _currentIndex = val;
            });
        },
        items: [
          BottomNavigationBarItem(
            title: Text('Flutter'),
            icon: Icon(Icons.info),
          ),
          BottomNavigationBarItem(
            title: Text('Dart'),
            icon: Icon(Icons.info_outline),
          ),
        ],
      ),
    );
  }

  String _getUrl(int val) {
    switch (val) {
      case 0:
        return 'https://flutter.dev';
      case 1:
        return 'https://dart.dev';
      default:
        return 'https://google.com';
    }
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  easy_web_view: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:easy_web_view/easy_web_view.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
83
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
89
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Maintenance suggestions

The package description is too short. (-11 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cupertino_icons ^0.1.2 0.1.3
flutter 0.0.0
webview_flutter ^0.3.15+1 0.3.19+5
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test