Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
More checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Mar 5, 2021
1 parent 911cd97 commit c223060
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void main() {
});
});

group('$SurfaceAndroidWebView', () {
group('SurfaceAndroidWebView', () {
setUpAll(() {
WebView.platform = SurfaceAndroidWebView();
});
Expand Down Expand Up @@ -902,6 +902,8 @@ void main() {

testWidgets('inputs are scrolled into view when focused',
(WidgetTester tester) async {
expect(Platform.isAndroid, isTrue);

final String scrollTestPage = '''
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -1004,7 +1006,7 @@ void main() {
viewportRectRelativeToViewport['right'],
isTrue);
});
}, skip: !Platform.isAndroid);
}, skip: Platform.isAndroid ? false : 'Platform isn\'t Android');

group('NavigationDelegate', () {
final String blankPage = "<!DOCTYPE html><head></head><body></body></html>";
Expand Down
2 changes: 2 additions & 0 deletions packages/webview_flutter/lib/webview_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
Expand Down Expand Up @@ -85,6 +86,7 @@ class SurfaceAndroidWebView extends AndroidWebView {
Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
required WebViewPlatformCallbacksHandler webViewPlatformCallbacksHandler,
}) {
assert(Platform.isAndroid);
assert(webViewPlatformCallbacksHandler != null);
return PlatformViewLink(
viewType: 'plugins.flutter.io/webview',
Expand Down

0 comments on commit c223060

Please sign in to comment.