This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webview_flutter_android] Adds support for selecting Hybrid Compositi…
…on (#6864) * add displayWithHybridComposition flag * move duplicate method * unit tests * adds * update docs * create platformviewsserviceproxy * use proxy for platformviewsservice * remove usused code * update display mode * use clever imports
- Loading branch information
1 parent
c61ac23
commit 15cfe8a
Showing
8 changed files
with
1,110 additions
and
364 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/webview_flutter/webview_flutter_android/CHANGELOG.md
This file contains 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 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 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 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
53 changes: 53 additions & 0 deletions
53
packages/webview_flutter/webview_flutter_android/lib/src/platform_views_service_proxy.dart
This file contains 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,53 @@ | ||
// 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 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
/// Proxy that provides access to the platform views service. | ||
/// | ||
/// This service allows creating and controlling platform-specific views. | ||
@immutable | ||
class PlatformViewsServiceProxy { | ||
/// Constructs a [PlatformViewsServiceProxy]. | ||
const PlatformViewsServiceProxy(); | ||
|
||
/// Proxy method for [PlatformViewsService.initExpensiveAndroidView]. | ||
ExpensiveAndroidViewController initExpensiveAndroidView({ | ||
required int id, | ||
required String viewType, | ||
required TextDirection layoutDirection, | ||
dynamic creationParams, | ||
MessageCodec<dynamic>? creationParamsCodec, | ||
VoidCallback? onFocus, | ||
}) { | ||
return PlatformViewsService.initExpensiveAndroidView( | ||
id: id, | ||
viewType: viewType, | ||
layoutDirection: layoutDirection, | ||
creationParams: creationParams, | ||
creationParamsCodec: creationParamsCodec, | ||
onFocus: onFocus, | ||
); | ||
} | ||
|
||
/// Proxy method for [PlatformViewsService.initSurfaceAndroidView]. | ||
SurfaceAndroidViewController initSurfaceAndroidView({ | ||
required int id, | ||
required String viewType, | ||
required TextDirection layoutDirection, | ||
dynamic creationParams, | ||
MessageCodec<dynamic>? creationParamsCodec, | ||
VoidCallback? onFocus, | ||
}) { | ||
return PlatformViewsService.initSurfaceAndroidView( | ||
id: id, | ||
viewType: viewType, | ||
layoutDirection: layoutDirection, | ||
creationParams: creationParams, | ||
creationParamsCodec: creationParamsCodec, | ||
onFocus: onFocus, | ||
); | ||
} | ||
} |
This file contains 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.