File tree Expand file tree Collapse file tree 4 files changed +63
-1
lines changed
packages/webview_flutter/webview_flutter_platform_interface Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.12.0
2
+
3
+ * Adds support to set whether to draw the scrollbar. See
4
+ ` PlatformWebViewController.setVerticalScrollBarEnabled ` ,
5
+ ` PlatformWebViewController.setHorizontalScrollBarEnabled ` ,
6
+ ` PlatformWebViewController.supportsSetScrollBarsEnabled ` .
7
+
1
8
## 2.11.0
2
9
3
10
* Adds support to set the over-scroll mode for the WebView. See ` PlatformWebViewController.setOverScrollMode ` .
Original file line number Diff line number Diff line change @@ -229,6 +229,26 @@ abstract class PlatformWebViewController extends PlatformInterface {
229
229
'scrollBy is not implemented on the current platform' );
230
230
}
231
231
232
+ /// Whether the vertical scrollbar should be drawn or not.
233
+ Future <void > setVerticalScrollBarEnabled (bool enabled) {
234
+ throw UnimplementedError (
235
+ 'setVerticalScrollBarEnabled is not implemented on the current platform' );
236
+ }
237
+
238
+ /// Whether the horizontal scrollbar should be drawn or not.
239
+ Future <void > setHorizontalScrollBarEnabled (bool enabled) {
240
+ throw UnimplementedError (
241
+ 'setHorizontalScrollBarEnabled is not implemented on the current platform' );
242
+ }
243
+
244
+ /// Returns true if the current platform supports setting whether scrollbars
245
+ /// should be drawn or not.
246
+ ///
247
+ /// See [setVerticalScrollBarEnabled] and [setHorizontalScrollBarEnabled] .
248
+ bool supportsSetScrollBarsEnabled () {
249
+ return false ;
250
+ }
251
+
232
252
/// Return the current scroll position of this view.
233
253
///
234
254
/// Scroll position is measured from the top left.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/webview_flutt
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview_flutter%22
5
5
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
6
6
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7
- version : 2.11 .0
7
+ version : 2.12 .0
8
8
9
9
environment :
10
10
sdk : ^3.4.0
Original file line number Diff line number Diff line change @@ -311,6 +311,41 @@ void main() {
311
311
);
312
312
});
313
313
314
+ test (
315
+ 'Default implementation of setVerticalScrollBarEnabled should throw unimplemented error' ,
316
+ () {
317
+ final PlatformWebViewController controller =
318
+ ExtendsPlatformWebViewController (
319
+ const PlatformWebViewControllerCreationParams ());
320
+
321
+ expect (
322
+ () => controller.setVerticalScrollBarEnabled (false ),
323
+ throwsUnimplementedError,
324
+ );
325
+ });
326
+
327
+ test (
328
+ 'Default implementation of setHorizontalScrollBarEnabled should throw unimplemented error' ,
329
+ () {
330
+ final PlatformWebViewController controller =
331
+ ExtendsPlatformWebViewController (
332
+ const PlatformWebViewControllerCreationParams ());
333
+
334
+ expect (
335
+ () => controller.setHorizontalScrollBarEnabled (false ),
336
+ throwsUnimplementedError,
337
+ );
338
+ });
339
+
340
+ test ('Default implementation of supportsSetScrollBarsEnabled returns false' ,
341
+ () {
342
+ final PlatformWebViewController controller =
343
+ ExtendsPlatformWebViewController (
344
+ const PlatformWebViewControllerCreationParams ());
345
+
346
+ expect (controller.supportsSetScrollBarsEnabled (), isFalse);
347
+ });
348
+
314
349
test (
315
350
'Default implementation of getScrollPosition should throw unimplemented error' ,
316
351
() {
You can’t perform that action at this time.
0 commit comments