@@ -24,6 +24,8 @@ enum _WebViewNavigateType {
24
24
class FlutterWebViewPlugin {
25
25
final MethodChannel _channel;
26
26
27
+ /// iOS WebView: Implemented
28
+ /// Android WebView: not implemented
27
29
final EventChannel _event;
28
30
Stream <String > _stateChanged;
29
31
@@ -96,39 +98,45 @@ class FlutterWebViewPlugin {
96
98
/// android: Implemented.
97
99
/// - [clearCache] clear the cache of the Webview
98
100
/// iOS WebView: Not implemented yet
99
- /// iOS WKWebView: will implement later
101
+ /// iOS WkWebView: TODO: later
100
102
/// android: Implemented
101
103
/// - [clearCookies] clear all cookies of the Webview
102
104
/// iOS WebView: Not implemented yet
103
- /// iOS WKWebView : will implement later
105
+ /// iOS WkWebView : will implement later
104
106
/// android: Implemented
105
107
/// - [hidden] not show
106
108
/// iOS WebView: not shown(addSubView) in ViewController
107
- /// android: Implemented
109
+ /// android: Not implemented yet.
108
110
/// [fullScreen] : show in full screen mode, default true
109
111
/// iOS WebView: without rect, show in full screen mode
110
- /// android: Not implemented yet
112
+ /// android: Implemented
111
113
/// [rect] : show in rect(not full screen)
112
114
/// iOS WebView: worked
113
115
/// android: Not implemented yet
114
- /// [enableAppScheme] : false will enable all schemes, true only for
115
- /// httt/https/about
116
+ /// [enableAppScheme] : false will enable all schemes, true only for httt/https/about
117
+ /// iOS WebView: worked
118
+ /// android: Not implemented yet
119
+ /// [userAgent] : set the User-Agent of WebView
120
+ /// iOS WebView: worked
121
+ /// android: Not implemented yet
116
122
Future <Null > launch (String url,
117
123
{bool withJavascript: true ,
118
124
bool clearCache: false ,
119
125
bool clearCookies: false ,
120
126
bool hidden: false ,
121
127
bool fullScreen: true ,
122
128
bool enableAppScheme: true ,
123
- Rect rect: null }) async {
129
+ Rect rect: null ,
130
+ String userAgent: null }) async {
124
131
Map <String , dynamic > args = {
125
132
"url" : url,
126
133
"withJavascript" : withJavascript,
127
134
"clearCache" : clearCache,
128
135
"hidden" : hidden,
129
136
"clearCookies" : clearCookies,
130
137
"fullScreen" : fullScreen,
131
- "enableAppScheme" : enableAppScheme
138
+ "enableAppScheme" : enableAppScheme,
139
+ "userAgent" : userAgent
132
140
};
133
141
if (! fullScreen) assert (rect != null );
134
142
if (rect != null ) {
@@ -142,6 +150,8 @@ class FlutterWebViewPlugin {
142
150
await _channel.invokeMethod ('launch' , args);
143
151
}
144
152
153
+ /// iOS WebView: worked
154
+ /// android: Not implemented yet
145
155
Future <String > evalJavascript (String code) {
146
156
return _channel.invokeMethod ('eval' , {"code" : code});
147
157
}
@@ -151,6 +161,7 @@ class FlutterWebViewPlugin {
151
161
Future <Null > close () => _channel.invokeMethod ("close" );
152
162
153
163
/// Listening url changed
154
- ///
164
+ /// iOS WebView: worked
165
+ /// android: worked
155
166
Stream <String > get onUrlChanged => _onUrlChanged.stream;
156
167
}
0 commit comments