first commit federated-plugin

This commit is contained in:
Lorenzo Pichilli 2023-11-17 23:28:11 +01:00
parent 79024b24da
commit 1486b5af38
771 changed files with 21512 additions and 7599 deletions

View File

@ -1 +0,0 @@
flutter_inappbrowser

View File

@ -1,29 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/flutter_inappwebview.iml" filepath="$PROJECT_DIR$/flutter_inappwebview.iml" />
</modules>
</component>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -214,12 +214,12 @@ void customTabs() {
}); });
skippableTest('getMaxToolbarItems', () async { skippableTest('getMaxToolbarItems', () async {
expect(await ChromeSafariBrowser.getMaxToolbarItems(), expect(await PlatformChromeSafariBrowser.getMaxToolbarItems(),
greaterThanOrEqualTo(0)); greaterThanOrEqualTo(0));
}); });
skippableTest('getPackageName', () async { skippableTest('getPackageName', () async {
expect(await ChromeSafariBrowser.getPackageName(), isNotNull); expect(await PlatformChromeSafariBrowser.getPackageName(), isNotNull);
}); });
}, skip: shouldSkip); }, skip: shouldSkip);
} }

View File

@ -32,10 +32,10 @@ void sfSafariViewController() {
skippableTest('create and invalidate Prewarming Token', () async { skippableTest('create and invalidate Prewarming Token', () async {
final prewarmingToken = final prewarmingToken =
await ChromeSafariBrowser.prewarmConnections([TEST_URL_1]); await PlatformChromeSafariBrowser.prewarmConnections([TEST_URL_1]);
expect(prewarmingToken, isNotNull); expect(prewarmingToken, isNotNull);
await expectLater( await expectLater(
ChromeSafariBrowser.invalidatePrewarmingToken(prewarmingToken!), PlatformChromeSafariBrowser.invalidatePrewarmingToken(prewarmingToken!),
completes); completes);
}); });
}, skip: shouldSkip); }, skip: shouldSkip);

View File

@ -9,7 +9,7 @@ void apply() {
skippableTestWidgets('apply', (WidgetTester tester) async { skippableTestWidgets('apply', (WidgetTester tester) async {
await expectLater( await expectLater(
ProcessGlobalConfig.instance().apply( PlatformProcessGlobalConfig.instance().apply(
settings: ProcessGlobalConfigSettings( settings: ProcessGlobalConfigSettings(
dataDirectorySuffix: dataDirectorySuffix:
(await WebViewFeature.isStartupFeatureSupported( (await WebViewFeature.isStartupFeatureSupported(

View File

@ -17,7 +17,7 @@ void clearAndSetProxyOverride() {
await WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE); await WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE);
if (proxyAvailable) { if (proxyAvailable) {
ProxyController proxyController = ProxyController.instance(); PlatformProxyController proxyController = PlatformProxyController.instance();
await proxyController.clearProxyOverride(); await proxyController.clearProxyOverride();
await proxyController.setProxyOverride( await proxyController.setProxyOverride(

View File

@ -17,8 +17,8 @@ void setServiceWorkerClient() {
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST);
if (swAvailable && swInterceptAvailable) { if (swAvailable && swInterceptAvailable) {
ServiceWorkerController serviceWorkerController = PlatformServiceWorkerController serviceWorkerController =
ServiceWorkerController.instance(); PlatformServiceWorkerController.instance();
await serviceWorkerController.setServiceWorkerClient(null); await serviceWorkerController.setServiceWorkerClient(null);
} }

View File

@ -16,8 +16,8 @@ void shouldInterceptRequest() {
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST);
if (swAvailable && swInterceptAvailable) { if (swAvailable && swInterceptAvailable) {
ServiceWorkerController serviceWorkerController = PlatformServiceWorkerController serviceWorkerController =
ServiceWorkerController.instance(); PlatformServiceWorkerController.instance();
await serviceWorkerController.setServiceWorkerClient(ServiceWorkerClient( await serviceWorkerController.setServiceWorkerClient(ServiceWorkerClient(
shouldInterceptRequest: (request) async { shouldInterceptRequest: (request) async {

View File

@ -111,7 +111,7 @@ class MyInAppBrowser extends InAppBrowser {
} }
} }
class MyChromeSafariBrowser extends ChromeSafariBrowser { class MyChromeSafariBrowser extends PlatformChromeSafariBrowser {
final Completer<void> serviceConnected = Completer<void>(); final Completer<void> serviceConnected = Completer<void>();
final Completer<void> opened = Completer<void>(); final Completer<void> opened = Completer<void>();
final Completer<bool?> firstPageLoaded = Completer<bool?>(); final Completer<bool?> firstPageLoaded = Completer<bool?>();

View File

@ -22,8 +22,8 @@ void main() {
WebView.debugLoggingSettings.maxLogMessageLength = 7000; WebView.debugLoggingSettings.maxLogMessageLength = 7000;
InAppBrowser.debugLoggingSettings.usePrint = true; InAppBrowser.debugLoggingSettings.usePrint = true;
InAppBrowser.debugLoggingSettings.maxLogMessageLength = 7000; InAppBrowser.debugLoggingSettings.maxLogMessageLength = 7000;
ChromeSafariBrowser.debugLoggingSettings.usePrint = true; PlatformChromeSafariBrowser.debugLoggingSettings.usePrint = true;
ChromeSafariBrowser.debugLoggingSettings.maxLogMessageLength = 7000; PlatformChromeSafariBrowser.debugLoggingSettings.maxLogMessageLength = 7000;
WebAuthenticationSession.debugLoggingSettings.usePrint = true; WebAuthenticationSession.debugLoggingSettings.usePrint = true;
WebAuthenticationSession.debugLoggingSettings.maxLogMessageLength = 7000; WebAuthenticationSession.debugLoggingSettings.maxLogMessageLength = 7000;
PullToRefreshController.debugLoggingSettings.usePrint = true; PullToRefreshController.debugLoggingSettings.usePrint = true;

View File

@ -4,7 +4,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'main.dart'; import 'main.dart';
class MyChromeSafariBrowser extends ChromeSafariBrowser { class MyChromeSafariBrowser extends PlatformChromeSafariBrowser {
@override @override
void onOpened() { void onOpened() {
print("ChromeSafari browser opened"); print("ChromeSafari browser opened");
@ -22,7 +22,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
} }
class ChromeSafariBrowserExampleScreen extends StatefulWidget { class ChromeSafariBrowserExampleScreen extends StatefulWidget {
final ChromeSafariBrowser browser = MyChromeSafariBrowser(); final PlatformChromeSafariBrowser browser = MyChromeSafariBrowser();
@override @override
_ChromeSafariBrowserExampleScreenState createState() => _ChromeSafariBrowserExampleScreenState createState() =>

View File

@ -11,8 +11,13 @@ import 'main.dart';
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
MyInAppBrowser( MyInAppBrowser(
{int? windowId, UnmodifiableListView<UserScript>? initialUserScripts}) {int? windowId,
: super(windowId: windowId, initialUserScripts: initialUserScripts); UnmodifiableListView<UserScript>? initialUserScripts,
PullToRefreshController? pullToRefreshController})
: super(
windowId: windowId,
initialUserScripts: initialUserScripts,
pullToRefreshController: pullToRefreshController);
@override @override
Future onBrowserCreated() async { Future onBrowserCreated() async {
@ -59,21 +64,19 @@ class MyInAppBrowser extends InAppBrowser {
} }
class InAppBrowserExampleScreen extends StatefulWidget { class InAppBrowserExampleScreen extends StatefulWidget {
final MyInAppBrowser browser = new MyInAppBrowser();
@override @override
_InAppBrowserExampleScreenState createState() => _InAppBrowserExampleScreenState createState() =>
new _InAppBrowserExampleScreenState(); new _InAppBrowserExampleScreenState();
} }
class _InAppBrowserExampleScreenState extends State<InAppBrowserExampleScreen> { class _InAppBrowserExampleScreenState extends State<InAppBrowserExampleScreen> {
PullToRefreshController? pullToRefreshController; late final MyInAppBrowser browser;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
pullToRefreshController = kIsWeb || PullToRefreshController? pullToRefreshController = kIsWeb ||
![TargetPlatform.iOS, TargetPlatform.android] ![TargetPlatform.iOS, TargetPlatform.android]
.contains(defaultTargetPlatform) .contains(defaultTargetPlatform)
? null ? null
@ -83,15 +86,16 @@ class _InAppBrowserExampleScreenState extends State<InAppBrowserExampleScreen> {
), ),
onRefresh: () async { onRefresh: () async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
widget.browser.webViewController?.reload(); browser.webViewController?.reload();
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
widget.browser.webViewController?.loadUrl( browser.webViewController?.loadUrl(
urlRequest: URLRequest( urlRequest: URLRequest(
url: await widget.browser.webViewController?.getUrl())); url: await browser.webViewController?.getUrl()));
} }
}, },
); );
widget.browser.pullToRefreshController = pullToRefreshController;
browser = MyInAppBrowser(pullToRefreshController: pullToRefreshController);
} }
@override @override
@ -108,7 +112,7 @@ class _InAppBrowserExampleScreenState extends State<InAppBrowserExampleScreen> {
children: <Widget>[ children: <Widget>[
ElevatedButton( ElevatedButton(
onPressed: () async { onPressed: () async {
await widget.browser.openUrlRequest( await browser.openUrlRequest(
urlRequest: urlRequest:
URLRequest(url: WebUri("https://flutter.dev")), URLRequest(url: WebUri("https://flutter.dev")),
settings: InAppBrowserClassSettings( settings: InAppBrowserClassSettings(

View File

@ -15,7 +15,7 @@ class InAppWebViewExampleScreen extends StatefulWidget {
class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
final GlobalKey webViewKey = GlobalKey(); final GlobalKey webViewKey = GlobalKey();
InAppWebViewController? webViewController; PlatformInAppWebViewController? webViewController;
InAppWebViewSettings settings = InAppWebViewSettings( InAppWebViewSettings settings = InAppWebViewSettings(
isInspectable: kDebugMode, isInspectable: kDebugMode,
mediaPlaybackRequiresUserGesture: false, mediaPlaybackRequiresUserGesture: false,

View File

@ -12,7 +12,7 @@ class WebAuthenticationSessionExampleScreen extends StatefulWidget {
class _WebAuthenticationSessionExampleScreenState class _WebAuthenticationSessionExampleScreenState
extends State<WebAuthenticationSessionExampleScreen> { extends State<WebAuthenticationSessionExampleScreen> {
WebAuthenticationSession? session; PlatformWebAuthenticationSession? session;
String? token; String? token;
@override @override

30
flutter_inappwebview_android/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

View File

@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e"
channel: "stable"
project_type: plugin
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
- platform: android
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@ -0,0 +1,3 @@
## 0.0.1
* TODO: Describe initial release.

View File

@ -0,0 +1 @@
TODO: Add your license here.

View File

@ -0,0 +1,15 @@
# flutter_inappwebview_android
Android implementation of the flutter_inappwebview plugin.
## Getting Started
This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
For help getting started with Flutter development, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

View File

@ -0,0 +1,11 @@
include: package:flutter_lints/flutter.yaml
linter:
rules:
constant_identifier_names: ignore
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
errors:
deprecated_member_use_from_same_package: ignore

Some files were not shown because too many files have changed in this diff Show More