Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Nov 11, 2023
1 parent 18c3c1f commit d5a0bb3
Show file tree
Hide file tree
Showing 21 changed files with 152 additions and 179 deletions.
6 changes: 4 additions & 2 deletions lib/src/chrome_safari_browser/chrome_safari_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ class ChromeSafariBrowser extends ChannelController {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('relation', () => relation.toNativeValue());
args.putIfAbsent('origin', () => origin.toString());
return await channel?.invokeMethod<bool>("validateRelationship", args) ?? false;
return await channel?.invokeMethod<bool>("validateRelationship", args) ??
false;
}

///Closes the [ChromeSafariBrowser] instance.
Expand Down Expand Up @@ -401,7 +402,8 @@ class ChromeSafariBrowser extends ChannelController {
///- Android
static Future<int> getMaxToolbarItems() async {
Map<String, dynamic> args = <String, dynamic>{};
return await _sharedChannel.invokeMethod<int>("getMaxToolbarItems", args) ?? 0;
return await _sharedChannel.invokeMethod<int>("getMaxToolbarItems", args) ??
0;
}

///Clear associated website data accrued from browsing activity within your app.
Expand Down
10 changes: 5 additions & 5 deletions lib/src/cookie_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class CookieManager {
bool? isHttpOnly,
HTTPCookieSameSitePolicy? sameSite,
@Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async {
webViewController = webViewController ?? iosBelow11WebViewController;

Expand Down Expand Up @@ -204,7 +204,7 @@ class CookieManager {
Future<List<Cookie>> getCookies(
{required WebUri url,
@Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty);

Expand Down Expand Up @@ -318,7 +318,7 @@ class CookieManager {
{required WebUri url,
required String name,
@Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty);
assert(name.isNotEmpty);
Expand Down Expand Up @@ -381,7 +381,7 @@ class CookieManager {
String path = "/",
String? domain,
@Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty);
assert(name.isNotEmpty);
Expand Down Expand Up @@ -433,7 +433,7 @@ class CookieManager {
String path = "/",
String? domain,
@Deprecated("Use webViewController instead")
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? iosBelow11WebViewController,
InAppWebViewController? webViewController}) async {
assert(url.toString().isNotEmpty);

Expand Down
3 changes: 1 addition & 2 deletions lib/src/in_app_browser/in_app_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class InAppBrowser extends ChannelController {
}

_init() {
channel =
MethodChannel('com.pichillilorenzo/flutter_inappbrowser_$id');
channel = MethodChannel('com.pichillilorenzo/flutter_inappbrowser_$id');
handler = _handleMethod;
initMethodCallHandler();

Expand Down
4 changes: 3 additions & 1 deletion lib/src/in_app_localhost_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class InAppLocalhostServer {
path = _documentRoot + path;

try {
body = (await rootBundle.load(Uri.decodeFull(path))).buffer.asUint8List();
body = (await rootBundle.load(Uri.decodeFull(path)))
.buffer
.asUint8List();
} catch (e) {
print(e.toString());
request.response.close();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/in_app_webview/apple/in_app_webview_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class IOSInAppWebViewController {
@Deprecated("Use InAppWebViewController.createPdf instead")
Future<Uint8List?> createPdf(
{@Deprecated("Use pdfConfiguration instead")
// ignore: deprecated_member_use_from_same_package
IOSWKPDFConfiguration? iosWKPdfConfiguration,
// ignore: deprecated_member_use_from_same_package
IOSWKPDFConfiguration? iosWKPdfConfiguration,
PDFConfiguration? pdfConfiguration}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('pdfConfiguration',
Expand Down
67 changes: 30 additions & 37 deletions lib/src/in_app_webview/headless_in_app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import '../types/disposable.dart';
///- Web
///- MacOS
///{@endtemplate}
class HeadlessInAppWebView extends ChannelController implements WebView, Disposable {
class HeadlessInAppWebView extends ChannelController
implements WebView, Disposable {
///View ID.
late final String id;

Expand Down Expand Up @@ -68,8 +69,7 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.initialUrlRequest,
this.initialFile,
this.initialData,
@Deprecated('Use initialSettings instead')
this.initialOptions,
@Deprecated('Use initialSettings instead') this.initialOptions,
this.initialSettings,
this.contextMenu,
this.initialUserScripts,
Expand All @@ -78,22 +78,19 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onWebViewCreated,
this.onLoadStart,
this.onLoadStop,
@Deprecated("Use onReceivedError instead")
this.onLoadError,
@Deprecated("Use onReceivedError instead") this.onLoadError,
this.onReceivedError,
@Deprecated("Use onReceivedHttpError instead")
this.onLoadHttpError,
@Deprecated("Use onReceivedHttpError instead") this.onLoadHttpError,
this.onReceivedHttpError,
this.onProgressChanged,
this.onConsoleMessage,
this.shouldOverrideUrlLoading,
this.onLoadResource,
this.onScrollChanged,
@Deprecated('Use onDownloadStartRequest instead')
this.onDownloadStart,
@Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead')
this.onLoadResourceCustomScheme,
this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme,
this.onCreateWindow,
this.onCloseWindow,
Expand All @@ -104,14 +101,13 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest,
@Deprecated('Use FindInteractionController.onFindResultReceived instead')
this.onFindResultReceived,
this.onFindResultReceived,
this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange,
this.onAjaxProgress,
this.shouldInterceptFetchRequest,
this.onUpdateVisitedHistory,
@Deprecated("Use onPrintRequest instead")
this.onPrint,
@Deprecated("Use onPrintRequest instead") this.onPrint,
this.onPrintRequest,
this.onLongPressHitTestResult,
this.onEnterFullscreen,
Expand All @@ -122,59 +118,57 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa
this.onWindowBlur,
this.onOverScrolled,
@Deprecated('Use onSafeBrowsingHit instead')
this.androidOnSafeBrowsingHit,
this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest,
this.androidOnPermissionRequest,
this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt,
this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt,
this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest,
this.androidShouldInterceptRequest,
this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone,
this.androidOnRenderProcessGone,
this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive,
this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive,
this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission,
this.androidOnFormResubmission,
this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead')
this.androidOnScaleChanged,
@Deprecated('Use onReceivedIcon instead')
this.androidOnReceivedIcon,
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl,
this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead')
this.androidOnJsBeforeUnload,
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest,
this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest,
this.onPermissionRequestCanceled,
this.onRequestFocus,
@Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate,
this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated(
'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse,
this.iosOnNavigationResponse,
this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS,
this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged,
Expand Down Expand Up @@ -364,8 +358,7 @@ class HeadlessInAppWebView extends ChannelController implements WebView, Disposa

Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic> sizeMap =
(await channel?.invokeMethod('getSize', args))
?.cast<String, dynamic>();
(await channel?.invokeMethod('getSize', args))?.cast<String, dynamic>();
return MapSize.fromMap(sizeMap);
}

Expand Down
35 changes: 18 additions & 17 deletions lib/src/in_app_webview/in_app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class InAppWebView extends StatefulWidget implements WebView {
@Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
this.onDownloadStartRequest,
@Deprecated('Use onLoadResourceWithCustomScheme instead')
this.onLoadResourceCustomScheme,
this.onLoadResourceCustomScheme,
this.onLoadResourceWithCustomScheme,
this.onCreateWindow,
this.onCloseWindow,
Expand All @@ -112,7 +112,7 @@ class InAppWebView extends StatefulWidget implements WebView {
this.onReceivedServerTrustAuthRequest,
this.onReceivedClientCertRequest,
@Deprecated('Use FindInteractionController.onFindResultReceived instead')
this.onFindResultReceived,
this.onFindResultReceived,
this.shouldInterceptAjaxRequest,
this.onAjaxReadyStateChange,
this.onAjaxProgress,
Expand All @@ -132,53 +132,54 @@ class InAppWebView extends StatefulWidget implements WebView {
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
this.onSafeBrowsingHit,
@Deprecated('Use onPermissionRequest instead')
this.androidOnPermissionRequest,
this.androidOnPermissionRequest,
this.onPermissionRequest,
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
this.androidOnGeolocationPermissionsShowPrompt,
this.androidOnGeolocationPermissionsShowPrompt,
this.onGeolocationPermissionsShowPrompt,
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
this.androidOnGeolocationPermissionsHidePrompt,
this.androidOnGeolocationPermissionsHidePrompt,
this.onGeolocationPermissionsHidePrompt,
@Deprecated('Use shouldInterceptRequest instead')
this.androidShouldInterceptRequest,
this.androidShouldInterceptRequest,
this.shouldInterceptRequest,
@Deprecated('Use onRenderProcessGone instead')
this.androidOnRenderProcessGone,
this.androidOnRenderProcessGone,
this.onRenderProcessGone,
@Deprecated('Use onRenderProcessResponsive instead')
this.androidOnRenderProcessResponsive,
this.androidOnRenderProcessResponsive,
this.onRenderProcessResponsive,
@Deprecated('Use onRenderProcessUnresponsive instead')
this.androidOnRenderProcessUnresponsive,
this.androidOnRenderProcessUnresponsive,
this.onRenderProcessUnresponsive,
@Deprecated('Use onFormResubmission instead')
this.androidOnFormResubmission,
this.androidOnFormResubmission,
this.onFormResubmission,
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
this.onReceivedIcon,
@Deprecated('Use onReceivedTouchIconUrl instead')
this.androidOnReceivedTouchIconUrl,
this.androidOnReceivedTouchIconUrl,
this.onReceivedTouchIconUrl,
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
this.onJsBeforeUnload,
@Deprecated('Use onReceivedLoginRequest instead')
this.androidOnReceivedLoginRequest,
this.androidOnReceivedLoginRequest,
this.onReceivedLoginRequest,
this.onPermissionRequestCanceled,
this.onRequestFocus,
@Deprecated('Use onWebContentProcessDidTerminate instead')
this.iosOnWebContentProcessDidTerminate,
this.iosOnWebContentProcessDidTerminate,
this.onWebContentProcessDidTerminate,
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated(
'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
this.onDidReceiveServerRedirectForProvisionalNavigation,
@Deprecated('Use onNavigationResponse instead')
this.iosOnNavigationResponse,
this.iosOnNavigationResponse,
this.onNavigationResponse,
@Deprecated('Use shouldAllowDeprecatedTLS instead')
this.iosShouldAllowDeprecatedTLS,
this.iosShouldAllowDeprecatedTLS,
this.shouldAllowDeprecatedTLS,
this.onCameraCaptureStateChanged,
this.onMicrophoneCaptureStateChanged,
Expand Down
Loading

0 comments on commit d5a0bb3

Please sign in to comment.