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 {
expect(await ChromeSafariBrowser.getMaxToolbarItems(),
expect(await PlatformChromeSafariBrowser.getMaxToolbarItems(),
greaterThanOrEqualTo(0));
});
skippableTest('getPackageName', () async {
expect(await ChromeSafariBrowser.getPackageName(), isNotNull);
expect(await PlatformChromeSafariBrowser.getPackageName(), isNotNull);
});
}, skip: shouldSkip);
}

View File

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

View File

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

View File

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

View File

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

View File

@ -16,8 +16,8 @@ void shouldInterceptRequest() {
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST);
if (swAvailable && swInterceptAvailable) {
ServiceWorkerController serviceWorkerController =
ServiceWorkerController.instance();
PlatformServiceWorkerController serviceWorkerController =
PlatformServiceWorkerController.instance();
await serviceWorkerController.setServiceWorkerClient(ServiceWorkerClient(
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> opened = Completer<void>();
final Completer<bool?> firstPageLoaded = Completer<bool?>();

View File

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

View File

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

View File

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

View File

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

View File

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