From 0744743c9766f14cfc1b6429f69835375cecfa6c Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Fri, 5 Mar 2021 23:32:49 +0100 Subject: [PATCH] code formatting --- lib/src/in_app_browser/in_app_browser.dart | 18 +++++++++-- .../headless_in_app_webview.dart | 4 ++- lib/src/in_app_webview/in_app_webview.dart | 12 +++++-- lib/src/main.dart | 2 +- .../pull_to_refresh_controller.dart | 9 +++--- .../pull_to_refresh_options.dart | 17 +++++----- lib/src/types.dart | 32 +++++++------------ 7 files changed, 51 insertions(+), 43 deletions(-) diff --git a/lib/src/in_app_browser/in_app_browser.dart b/lib/src/in_app_browser/in_app_browser.dart index f273e1c3..2c131650 100755 --- a/lib/src/in_app_browser/in_app_browser.dart +++ b/lib/src/in_app_browser/in_app_browser.dart @@ -111,7 +111,11 @@ class InAppBrowser { args.putIfAbsent('windowId', () => windowId); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); - args.putIfAbsent('pullToRefreshOptions', () => pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap()); + args.putIfAbsent( + 'pullToRefreshOptions', + () => + pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap()); await _sharedChannel.invokeMethod('open', args); } @@ -165,7 +169,11 @@ class InAppBrowser { args.putIfAbsent('windowId', () => windowId); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); - args.putIfAbsent('pullToRefreshOptions', () => pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap()); + args.putIfAbsent( + 'pullToRefreshOptions', + () => + pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap()); await _sharedChannel.invokeMethod('open', args); } @@ -201,7 +209,11 @@ class InAppBrowser { args.putIfAbsent('windowId', () => windowId); args.putIfAbsent('initialUserScripts', () => initialUserScripts?.map((e) => e.toMap()).toList() ?? []); - args.putIfAbsent('pullToRefreshOptions', () => pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap()); + args.putIfAbsent( + 'pullToRefreshOptions', + () => + pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap()); await _sharedChannel.invokeMethod('open', args); } diff --git a/lib/src/in_app_webview/headless_in_app_webview.dart b/lib/src/in_app_webview/headless_in_app_webview.dart index b5ba9320..ffaae21d 100644 --- a/lib/src/in_app_webview/headless_in_app_webview.dart +++ b/lib/src/in_app_webview/headless_in_app_webview.dart @@ -129,7 +129,9 @@ class HeadlessInAppWebView implements WebView { 'windowId': this.windowId, 'initialUserScripts': this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], - 'pullToRefreshOptions': this.pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap() + 'pullToRefreshOptions': + this.pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap() }); await _sharedChannel.invokeMethod('createHeadlessWebView', args); } diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart index b9af4eb9..e31cfb93 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -385,7 +385,9 @@ class _InAppWebViewState extends State { 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], - 'pullToRefreshOptions': widget.pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap() + 'pullToRefreshOptions': + widget.pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap() }, creationParamsCodec: const StandardMessageCodec(), ) @@ -412,7 +414,9 @@ class _InAppWebViewState extends State { 'windowId': widget.windowId, 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], - 'pullToRefreshOptions': widget.pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap() + 'pullToRefreshOptions': + widget.pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap() }, creationParamsCodec: const StandardMessageCodec(), ); @@ -433,7 +437,9 @@ class _InAppWebViewState extends State { 'windowId': widget.windowId, 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], - 'pullToRefreshOptions': widget.pullToRefreshController?.options.toMap() ?? PullToRefreshOptions(enabled: false).toMap() + 'pullToRefreshOptions': + widget.pullToRefreshController?.options.toMap() ?? + PullToRefreshOptions(enabled: false).toMap() }, creationParamsCodec: const StandardMessageCodec(), ); diff --git a/lib/src/main.dart b/lib/src/main.dart index f11beba8..d692b27d 100644 --- a/lib/src/main.dart +++ b/lib/src/main.dart @@ -14,4 +14,4 @@ export 'in_app_localhost_server.dart'; export 'content_blocker.dart'; export 'http_auth_credentials_database.dart'; export 'context_menu.dart'; -export 'pull_to_refresh/main.dart'; \ No newline at end of file +export 'pull_to_refresh/main.dart'; diff --git a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart index aa19ca5e..95d4f171 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_controller.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_controller.dart @@ -26,8 +26,7 @@ class PullToRefreshController { Future handleMethod(MethodCall call) async { switch (call.method) { case "onRefresh": - if (onRefresh != null) - onRefresh!(); + if (onRefresh != null) onRefresh!(); break; default: throw UnimplementedError("Unimplemented ${call.method} method"); @@ -123,8 +122,8 @@ class PullToRefreshController { } void initMethodChannel(dynamic id) { - this._channel = - MethodChannel('com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_$id'); + this._channel = MethodChannel( + 'com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_$id'); this._channel?.setMethodCallHandler(handleMethod); } -} \ No newline at end of file +} diff --git a/lib/src/pull_to_refresh/pull_to_refresh_options.dart b/lib/src/pull_to_refresh/pull_to_refresh_options.dart index 8ce04e0e..7267c298 100644 --- a/lib/src/pull_to_refresh/pull_to_refresh_options.dart +++ b/lib/src/pull_to_refresh/pull_to_refresh_options.dart @@ -27,14 +27,13 @@ class PullToRefreshOptions { ///**NOTE**: Available only on iOS. IOSNSAttributedString? attributedTitle; - PullToRefreshOptions({ - this.enabled = true, - this.color, - this.backgroundColor, - this.distanceToTriggerSync, - this.slingshotDistance, - this.attributedTitle - }); + PullToRefreshOptions( + {this.enabled = true, + this.color, + this.backgroundColor, + this.distanceToTriggerSync, + this.slingshotDistance, + this.attributedTitle}); Map toMap() { return { @@ -55,4 +54,4 @@ class PullToRefreshOptions { String toString() { return toMap().toString(); } -} \ No newline at end of file +} diff --git a/lib/src/types.dart b/lib/src/types.dart index 79e08ea4..ff9651c5 100755 --- a/lib/src/types.dart +++ b/lib/src/types.dart @@ -6707,40 +6707,31 @@ class IOSNSUnderlineStyle { } ///Do not draw a line. - static const STYLE_NONE = - const IOSNSUnderlineStyle._internal(0); + static const STYLE_NONE = const IOSNSUnderlineStyle._internal(0); ///Draw a single line. - static const SINGLE = - const IOSNSUnderlineStyle._internal(1); + static const SINGLE = const IOSNSUnderlineStyle._internal(1); ///Draw a thick line. - static const THICK = - const IOSNSUnderlineStyle._internal(2); + static const THICK = const IOSNSUnderlineStyle._internal(2); ///Draw a double line. - static const DOUBLE = - const IOSNSUnderlineStyle._internal(9); + static const DOUBLE = const IOSNSUnderlineStyle._internal(9); ///Draw a line of dots. - static const PATTERN_DOT = - const IOSNSUnderlineStyle._internal(256); + static const PATTERN_DOT = const IOSNSUnderlineStyle._internal(256); ///Draw a line of dashes. - static const PATTERN_DASH = - const IOSNSUnderlineStyle._internal(512); + static const PATTERN_DASH = const IOSNSUnderlineStyle._internal(512); ///Draw a line of alternating dashes and dots. - static const PATTERN_DASH_DOT = - const IOSNSUnderlineStyle._internal(768); + static const PATTERN_DASH_DOT = const IOSNSUnderlineStyle._internal(768); ///Draw a line of alternating dashes and two dots. - static const PATTERN_DASH_DOT_DOT = - const IOSNSUnderlineStyle._internal(1024); + static const PATTERN_DASH_DOT_DOT = const IOSNSUnderlineStyle._internal(1024); ///Draw the line only beneath or through words, not whitespace. - static const BY_WORD = - const IOSNSUnderlineStyle._internal(32768); + static const BY_WORD = const IOSNSUnderlineStyle._internal(32768); bool operator ==(value) => value == _value; @@ -6777,11 +6768,10 @@ class IOSNSAttributedStringTextEffectStyle { ///A graphical text effect that gives glyphs the appearance of letterpress printing, which involves pressing the type into the paper. static const LETTERPRESS_STYLE = - const IOSNSAttributedStringTextEffectStyle._internal( - "letterpressStyle"); + const IOSNSAttributedStringTextEffectStyle._internal("letterpressStyle"); bool operator ==(value) => value == _value; @override int get hashCode => _value.hashCode; -} \ No newline at end of file +}