Explorar el Código

Minor changes.

Simon Lightfoot hace 7 años
padre
commit
0a5fdbd4e3

+ 1 - 2
android/build.gradle

@@ -1,4 +1,4 @@
-group 'com.yourcompany.flutter_webview_plugin'
+group 'com.flutter_webview_plugin'
 version '1.0-SNAPSHOT'
 
 buildscript {
@@ -25,7 +25,6 @@ android {
 
     defaultConfig {
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-        minSdkVersion 16
     }
     lintOptions {
         disable 'InvalidPackage'

+ 0 - 1
android/src/main/AndroidManifest.xml

@@ -1,4 +1,3 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.flutter_webview_plugin">
-
 </manifest>

+ 1 - 3
example/lib/main.dart

@@ -9,9 +9,7 @@ const kAndroidUserAgent =
 
 String selectedUrl = 'https://flutter.io';
 
-void main() {
-  runApp(MyApp());
-}
+void main() => runApp(MyApp());
 
 class MyApp extends StatelessWidget {
   final flutterWebViewPlugin = FlutterWebviewPlugin();

+ 9 - 9
lib/src/base.dart

@@ -151,34 +151,34 @@ class FlutterWebviewPlugin {
 
   /// Close the Webview
   /// Will trigger the [onDestroy] event
-  Future close() => _channel.invokeMethod('close');
+  Future<Null> close() async => await _channel.invokeMethod('close');
 
   /// Reloads the WebView.
-  Future reload() => _channel.invokeMethod('reload');
+  Future<Null> reload() async => await _channel.invokeMethod('reload');
 
   /// Navigates back on the Webview.
-  Future goBack() => _channel.invokeMethod('back');
+  Future<Null> goBack() async => await _channel.invokeMethod('back');
 
   /// Navigates forward on the Webview.
-  Future goForward() => _channel.invokeMethod('forward');
+  Future<Null> goForward() async => await _channel.invokeMethod('forward');
 
   // Hides the webview
-  Future hide() => _channel.invokeMethod('hide');
+  Future<Null> hide() async => await _channel.invokeMethod('hide');
 
   // Shows the webview
-  Future show() => _channel.invokeMethod('show');
+  Future<Null> show() async => await _channel.invokeMethod('show');
 
   // Reload webview with a url
-  Future reloadUrl(String url) async {
+  Future<Null> reloadUrl(String url) async {
     final args = <String, String>{'url': url};
     await _channel.invokeMethod('reloadUrl', args);
   }
 
   // Clean cookies on WebView
-  Future cleanCookies() async => _channel.invokeMethod('cleanCookies');
+  Future<Null> cleanCookies() async => await _channel.invokeMethod('cleanCookies');
 
   // Stops current loading process
-  Future stopLoading() => _channel.invokeMethod('stopLoading');
+  Future<Null> stopLoading() async => await _channel.invokeMethod('stopLoading');
 
   /// Close all Streams
   void dispose() {

+ 4 - 4
lib/src/webview_scaffold.dart

@@ -14,8 +14,6 @@ class WebviewScaffold extends StatefulWidget {
     @required this.url,
     this.headers,
     this.withJavascript,
-    this.supportMultipleWindows,
-    this.appCacheEnabled,
     this.clearCache,
     this.clearCookies,
     this.enableAppScheme,
@@ -27,6 +25,8 @@ class WebviewScaffold extends StatefulWidget {
     this.withLocalStorage,
     this.withLocalUrl,
     this.scrollBar,
+    this.supportMultipleWindows,
+    this.appCacheEnabled,
     this.hidden = false,
     this.initialChild,
     this.allowFileURLs,
@@ -36,8 +36,6 @@ class WebviewScaffold extends StatefulWidget {
   final String url;
   final Map<String, String> headers;
   final bool withJavascript;
-  final bool supportMultipleWindows;
-  final bool appCacheEnabled;
   final bool clearCache;
   final bool clearCookies;
   final bool enableAppScheme;
@@ -49,6 +47,8 @@ class WebviewScaffold extends StatefulWidget {
   final bool withLocalStorage;
   final bool withLocalUrl;
   final bool scrollBar;
+  final bool supportMultipleWindows;
+  final bool appCacheEnabled;
   final bool hidden;
   final Widget initialChild;
   final bool allowFileURLs;