This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[webview_flutter_wkwebview] Add WKWebView method stubs #4990
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6b12960
Support WebViewMethods
bparrishMines e4b8627
lower path dependency
bparrishMines cf7a649
Empty commit
bparrishMines 4c89654
Merge branch 'main' of github.com:flutter/plugins into ios_webview_5
bparrishMines b3bb74a
docs and helper methods
bparrishMines ef61349
handle error in evaluatejavascript
bparrishMines c0a4158
ignore NSError code
bparrishMines 6af4ff5
added todo
bparrishMines 7e80f31
pr comments
bparrishMines 99605b3
dont handle exception for evaluateJavascript
bparrishMines e551f2b
Merge branch 'master' of github.com:flutter/plugins into ios_webview_5
bparrishMines 427af47
return objective c type stringS
bparrishMines a4c7359
formatting
bparrishMines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'dart:async'; | ||
import 'dart:math'; | ||
|
||
import '../web_kit/web_kit.dart'; | ||
|
||
/// A view that allows the scrolling and zooming of its contained views. | ||
/// | ||
/// Wraps [UIScrollView](https://developer.apple.com/documentation/uikit/uiscrollview?language=objc). | ||
class UIScrollView { | ||
/// Constructs a [UIScrollView] that is owned by [webView]. | ||
// TODO(bparrishMines): Remove ignore once constructor is implemented. | ||
// ignore: avoid_unused_constructor_parameters | ||
UIScrollView.fromWebView(WKWebView webView); | ||
|
||
/// Point at which the origin of the content view is offset from the origin of the scroll view. | ||
Future<Point<double>> get contentOffset { | ||
throw UnimplementedError(); | ||
} | ||
|
||
/// Move the scrolled position of this view. | ||
/// | ||
/// This method is not a part of UIKit and is only a helper method to make | ||
/// scrollBy atomic. | ||
Future<void> scrollBy(Point<double> offset) { | ||
throw UnimplementedError(); | ||
} | ||
|
||
/// Set point at which the origin of the content view is offset from the origin of the scroll view. | ||
/// | ||
/// The default value is `Point<double>(0.0, 0.0)`. | ||
set contentOffset(FutureOr<Point<double>> offset) { | ||
throw UnimplementedError(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of those things that makes me suspect going all the way to the native boundary isn't going to be a great experience (at least not without automatic language projection); having to plumb in new ancillary objects for minor usage could get ugly.
(No change needed here, just flagging as something we'll want to watch for over time as we evaluate this approach and think about whether we want to flex the boundary back a little.)